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.

[sendmail Parameters]Body[/sendmail]

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.

[sendmail to=you@xxx.com&from=me@xxx.com&subject=Hello]
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.

ParameterDescription
torecipient(s). Can be comma separated as in address@domain.com,address2@domain2.com
fromsender'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.
subjectthe 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.
saveonsuccessT or F (Optional) instructs WebDNA to save or not save the email files after successful transmission
saveonfailT 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):

An example:

------- /WebCatalogEngine/EMailFolder/SomeFileName.txt -----
to: support@webdna.us, WebDNA@webdna.us
from: WebMaster@YourDomain.com
subject: This is the Subject Line
Date: Mon, 05 Jan 2010 15:59:33 -0500

line 1
line 2
line 3
line 4
------------------------------------------------------


Sendmail and binary files
You can also send binary files (zip files, images...) using [sendmail].

Example:
[sendmail to=whoever@whereever.com&from=whoever@whereever.com&subject=testing zip attachment&Content-Type=multipart/mixed; boundary="1234abcd"&MIME-version=1.0][!]
[/!]--1234abcd
Content-Type: text/plain

This is the first part : just plain text.

The next part contains a zip file.

--1234abcd
Content-Type: application/x-zip-compressed; name="test.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="test.zip"

[encrypt method=base64&file=test.zip&EMAILFORMAT=T][/encrypt]

--1234abcd--
[/sendmail]


-Terry Wilson
Download WebDNA Now
 
Home | Contact | Support | Free Download | Developer Resources | Community Forum | Learn | News | Store | SiteMap

© Copyright 2013 WebDNA™ Software Corporation. ALL RIGHTS RESERVED - 3010 Revere St., Plover, WI 54467