Simplicty and flexibility!


Mail send action now handles attachments

Started by DG3 Development
You will need to Sign In to be able to comment on the Blog!

Mail send action now handles attachments

The mailsend action module has got a new method named sendmailwithattachments. This method do the same as mailsend, but can also take a list of files as a parameter. Make sure you have DG3 v.0.12.978 or newer.

This is how the mailsend action module work:

The methods depends on the module mailhanding that needs to be active. It will use defaults set there for any parameter you do not set in the method.


Any parameter can be set using a value, a livelive or a combination. Livelive uses the form [[ fieldname ]] and will replace the value with the value to a web field in the page with the name you put in the brackets.
Body can take the form of a /pageurl/ or the actual content as a text/html or a livelive tag for a field that holds the text or html.


- mailsend send mail from DG3 web page using java script and ajax with a subject and a body.

  Parameters
  - To
  - Subject
  - Body
  - From (use default if blank)
  - Server (use default if blank)
  - Port (use default if blank)
  - User name (use default if blank)
  - Password (use default if blank)
  - Use TLS    (use default if blank)
 
- sendmailwithattachments send mail from DG3 web page using javascript and ajax with subject, body and one or more file attachments.

The attachments will be looked up relative to static, so a filename like /myattachments/invoice.pdf will be prepended with the absolute path to the static files directory, so any file that you want to be sent as an attachment must be located in the static files.

  Parameters
  - To
  - Subject
  - Body
  - Attachments (; separated file list)
  - From (use default if blank)
  - Server (use default if blank)
  - Port (use default if blank)
  - User name (use default if blank)
  - Password (use default if blank)
  - Use TLS  (use default if blank)

Example:

<h1>Send email with attachments</h1>

<table>

<tr><td>To:</td><td>[! field to !]</td></tr>

<tr><td>Subject:</td><td>[! field subject !]</td></tr>

<tr><td>File list:</td><td>[! field filelist !]</td></tr>

</table>

<p>[! field body !]</p>

<p>[! button send !]</p>


Button action definition




Written by DG3 Development 17/04/13 at 12:40:47 DataEase Generation 3