Description
This function will send emails from OpenInsight using authenticated logins and/or a Secure Sockets Layer (SSL).
Syntax
RTI_CDOMail(mailservername,sendername, recipient, subject, body,cc, bcc, replyto, content, attachmentfilelist, Username, Password, useSSL)
Parameters
The function has the following parameters:
Parameter | Description |
---|---|
mailservername | The IP address of the mailserver. |
sendername | The email address of the sender of the email. |
recipient | The email address of the receiver of the email. |
subject | The subject of the mail message. |
body | The body of the mail message. This is text that is sent if the file to send is not able to be sent. |
cc | Additional recipients of the mail message. Multiple email addresses can be delimited by either semicolons (;) or value marks (@vm). |
bcc | Additional recipients of the mail message. These recipients are unknown to all other recipients. Multiple email addresses can be delimited by either semicolons (;) or value marks (@vm). |
replyto | The email address of the party that will receive any replies from the mail message. |
content | The override parameter of the default header types. |
e.g. | |
'Content-Type: text/plain' (plain email minus attachments) | |
'Content-Type: multipart/mixed; boundary="_-_-_-_"' (for when you want email plus attachments) | |
Setting the content parameter will interfere with all the header settings, and may cause problems with attachments (unless you take full control and build these into the email yourself). | |
attachmentfilelist | An @vm-delimited list of files to be attached to the email. The list should contain both paths and filenames. |
username | The username of the mail account. |
password | The password of the mail account. |
useSSL | A boolean flag. When TRUE$ SSL will be used when mailing. |
Returns
OpenInsight will return the error message received from CDO. These error message generally relate to configuration issues with CDO. The errors are version specific, therefore it is recommended that Microsoft's documentation be referenced.
Remarks
This function was built using the CDO.Net objects. Refer to your operating system configuration for errors regarding CDO.
See also
Example
mailservername = 'my.mailserver.com' mailserverPort='999';* use the proper port mailServer = mailServerName:':':mailserverPort username = 'my_username' password = 'my_password' useSSl = 1 body = 'This is a test of CDO Mail'' retval = rti_cdoMail( mailserver, sendername, recipient, subject, body, cc, bcc, replyto, content, attachmentfilelist, username, password, useSSl )
2 Comments
Don Bakke
There is an interesting discussion between Bruce Cameron and Bryan Shumsky about the proper use of the Content argument. Rather than attempt to translate I am simply going to refer people to the discussion thread labelled RTI_CDOMail - Content argument.
The main issue of interest is that the Content argument is not intended to be used on a normal basis, but if there is a need to submit a custom Content-Type settings, the Body and Content-Type are to be submitted as a single delimited array. Seems confusing to me at first blush, but anyone who has need to do this should review the thread first.
Don Bakke
Barry Stevens found out through the WORKS forum that there is an undocumented argument called otherOptions. Thus, the full calling signature for this routine is:
I checked the OpenInsight 10 Programmer's Reference Guide and it does mention this argument but gives it the name extraOptions. The description for this argument is as follows:
Fortunately, Bryan Shumsky provided more comprehensive documentation in this post. Here is what he wrote: