Sending a single record directly from Cardbox
This sample macro takes the currently displayed record and emails it to an address that you enter. This is useful if you are doing searches on behalf of other people and want to send them the results. You can modify it in various ways: for instance, you can send any images in the record as attachments to your email, and you can send the whole selection of records instead of just the current record.
Before you use this macro, set up the details of your own email address and your mail server (SMTP server) by using Tools > Options > Email.
To use this macro:
- Highlight the macro text.
- Press Ctrl+C to copy the text to the Clipboard.
- Tell Cardbox that you want to create a new macro.
- When you see the blank text of the macro, press Ctrl+V to paste the text you have copied.
- Make any changes you need: for example, changing the names of the fields.
The sample macro
Errors
If something goes wrong with communication with the SMTP server then the macro will terminate with an error message which should let you work out what the trouble is.
If you try to send a message to a non-existent email address then you will not normally receive an error from the macro, but you will later receive an email saying that the message could not be delivered.
Alternative: using a different format
The sample macro uses the currently active format. If you prefer to send the record using a different Cardbox format, put its name (in quotation marks) in place of the word Format in the WriteToString command.
Alternative: sending all the records in the current selection
To send all the records in the current selection, instead of just the current record, then instead of
in the sample macro, use
Extension: send attached images along with the record
If you want to send the images attached to a record along with the record itself, add the following lines just before the sender.Send command:
or if you are sending all selected records rather than just the current record,