Technical References - [sendmail]
There is hardly a website that doesn't at some point need to send an email, whether through a simple contact form, or as notifications to the buyer and seller when somebody buys something. WebDNA makes this simple and straightforward.
To send an email, use a SendMail context with the body of the email message inside. Specify "to," "subject," and "from" information in parameters of the SendMail context. WebDNA does not actually send the email; it writes a special file into the EmailFolder which the separate Emailer program scans nearly continuously, looking for mail to send. If the Emailer program is not running, the emails will sit there unsent. The Emailer program does not erase old outgoing email files until it has successfully completed sending the email. Then it moves them to the SentMail folder. If any of the emails are malformed and can't be sent, they are moved to the ProblemEmail folder.
This is the body of the email.
The date is [date][/sendmail]
Any WebDNA inside the [sendmail] is interpreted first, such as the [date] tag above. HTML is not relevant here. The body of the [sendmail] is written to a file just as it is coded on your page, returns, running spaces and all. Do not use paragraph tags or table code or any other html. If you insert a URL, just write the URL, including the http:// portion without the <a> tags. Most email software will recognize it as a URL and make it clickable.
|to||recipient(s). Can be comma separated as in firstname.lastname@example.org,email@example.com|
|from||sender's email address, which should be a legitimate address allowed to send mail through your mail server|
|reply-to||(Optional) Address the recipient's email client will insert when they reply to the mail. This can be any email address, and is useful for assuring that the recipients reply to the right person, since you must use a local address for the sender.|
|subject||the subject line|
|any header||(Optional) CC, BCC, or any extra MIME header information. For example, if you want to force the date of the email to something other than the server's default, add "Date=Mon, 05 Sep 2008 15:59:33 -0500" to the list of parameters.|
|saveonsuccess||T or F (Optional) instructs WebDNA to save or not save the email files after successful transmission|
|saveonfail||T or F (Optional) instructs WebDNA to save or not save the email files after failed transmission.|
WebDNA does not actually send the email; it writes a special file into an EmailFolder which the separate Emailer program uses to send the email. If the Emailer program is not running, no emails will be sent. The Emailer program does not erase old outgoing email files until it has successfully completed sending the email.
The email file format conforms to Unix SendMail native mail format. You can add any extra MIME headers at the top of the file, followed by a blank line and then the body of the message. The format is basically what you see in a Eudora email message.
If you wish to send emails from your own CGIs or programs (without using WebDNA's built-in [sendmail] context), you can write a text file into the EMailFolder specified in the EMailer preferences. The file must have the following format (only the text between the dashed lines goes into the email file):
------- /WebCatalogEngine/EMailFolder/SomeFileName.txt -----
to: firstname.lastname@example.org, WebDNA@webdna.us
subject: This is the Subject Line
Date: Mon, 05 Jan 2010 15:59:33 -0500
Sendmail and binary files
You can also send binary files (zip files, images...) using [sendmail].
[sendmail email@example.comfirstname.lastname@example.org&subject=testing zip attachment&Content-Type=multipart/mixed; boundary="1234abcd"&MIME-version=1.0][!]
This is the first part : just plain text.
The next part contains a zip file.
Content-Type: application/x-zip-compressed; name="test.zip"
Content-Disposition: inline; filename="test.zip"