p$TDV:Allg:SendMail
p$TDV:Allg:SendMail
Sending an email. This function works with an smtp-client named blat.exe that is installed during the ePOS installation. (smtp :Simple Mail Transfer Protocol). In case the options provided by this function do not suffice the tool can also be used directly. By simply changing to the ePOS exe32 directory using a command prompt and entering blat –h all existing commands will be displayed.
The function p$TDV:Allg:SendMail employs a parameter group of the type TDV:SendMail with the following structure:
Please note: In case an email with HTML content is to be sent, pictures can be referenced by entering a reference to an embedded graphic in the source. e.g.<img src="cid:header.jpg" alt="" /> The referenced graphic has to be sent with the option -embed, e.g. -embed header.jpg,logo.gif
Name | Name |
SMTPServer (*) | Name of the smtp server |
SMTPUser (*) | Registration name at the smtp server |
SMTPPassword | Password of the registration name |
SMTPPassCrypt | Alternatively an encrypted password can be used (f$encrypt) |
Von | Sender in clear text |
Absender (*) | Sender email address |
An (*) | Receiver email address |
CC | Address of a copy of the email |
BCC | Address of a copy of the email |
Betreff | Subject text of the email |
Text | The email text itself. This text is written to a file. |
TextDatei | Name of a file containing the email text. In case such a file exists the content of this file is sent instead of the selected text. The parameter text of this parameter group is then not interpreted. If the file ends with the extension .html the email is automatically sent as HTML mail. |
Option | Further options that can be set upon sending the email. |
Anhang | File names separated by comma |
The arrays marked with (*) are mandatory arrays, moreover either SMTPPassword or SMTPPassCrypt has to be filled. Depending on the settings of the SMTP server the information, specifying user and password may be may be skipped.
Syntax: | Text = p$TDV:Allg:SendMail( PGname ) | ||
| Argument | Type | Meaning |
| PGname | String | Name of the parameter group of type TDV: SendMail containing the email information. The name of the parameter group has to be enclosed in '. |
Result: | String | Protocol of sending the email | |
Example: | mail.SMTPServer = 'smtp.web.de' | ||
| mail.SMTPUser = 'MyName' | ||
| mail.SMTPPassword = 'MyPassword' | ||
| mail.Absender = 'berthold.nuessle@acbis.de' | ||
| mail.An = 'Kontakt@acbis.de' | ||
| mail.Betreff = 'Regarding ...' | ||
| mail.Text = ' This is an email sent by ePOS' | ||
| erg = p$tdv:allg:sendmail('mail') | ||