Email Context [SendMail Parameters]Body[/SendMail]
Sends an email to the specified address.

To send an email, put a SendMail context into a template with the body of the email message inside the context. 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 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.

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):

[SendMail]This is the body of the email.
The date is [date][/SendMail]

Any [xxx] values are first substituted for their real values (both in the parameters as well as the body of the message), then the email file is written into the EmailFolder, where the Emailer program checks for new files every few seconds and sends them out.

Parameters for the SendMail context:
 Parameter  Description
recipient(s) of this email, as in ","
return address, as in ""
subject line for email
You may specify any extra MIME header information by simply naming it and providing a value in the list of SendMail parameters. For example, if you want to force the date of the email to something other than the default, add "Date=Mon, 05 Jan 1998 15:59:33 -0500" to the list of parameters.
(Optional) instructs WebDNA to save or not save the email files after successful transmission.
(Optional) instructs WebDNA to save or not save the email files after failed transmission.


By default, after WebDNA has transmitted an email, the email file is moved from the EMAILFolder to either the EMAILCompleted or EMAILProblems folder, depending on the success or failure of the email transmission. You can use the 'SaveOnSuccess' and 'SaveOnFail' [SendMail] parameters to instruct WebDNA NOT to 'save' the email files. Here is an example:

WebDNA leads the way to productivity.

In the example above, the email file would not be 'saved' to the EmailCompleted folder after a successful transmission, but it would be saved to the EmailProblems folder it there was an error in transmission.


User Contributed Notes

Alan White  
03/17/2004 at 08:32:29
I was having great difficulty in having text from a textbox display carraige returns within a plain text [sendmail].  

Here is my solution

First your text box must be formatted as so :-

<textarea name="fieldName" rows="8" cols="30" value="">[input][/input]</textarea>

When writing to the database make sure you wrap this field in url tags like so:-


To display the contents of a database field that has carraige returns, you have to create a convertsofts.db which will take any carraige returns and display them in the plain text mail.

Create a convertsofts.db (name it however you like) containing the following:

from to
%0B %0A

Once this is done you can then pull the database info as you require by using the convertsofts.db in a [convertchars] context like so:-

[convertchars db=convertsofts.db][fieldName][/convertchars]

This should maintain any returns entered in the text box...



Michael Muller - 
09/17/2009 at 11:00:26
Is there a way to send html emails? Any options or http headers I can add to allow H1 etc tags render?

Copyright © 2008 WebDNA Software Corporation, Inc.