Description

Socket function used to send mail from an OpenInsight workstation.

Syntax

retval = SENDMAIL (mailservername, sendername, recipient, subject, body, cc, bcc, replyto, content, attachmentfilelist, username, password)

Parameters

ParameterDescription
mailservernameThe IP address of the mailserver.
sendernameThe email address of the sender of the email.
recipientThe email address of the receiver of the email.
subjectThe subject of the mail message.
bodyThe body of the mail message. This is text that is sent if the file to send is not able to be sent.
ccAdditional recipients of the mail message. Multiple email addresses can be delimited by either semicolons (;) or value marks (@vm).
bccAdditional 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).
replytoThe email address of the party that will receive any replies from the mail message.
contentThe 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).

attachmentfilelistAn @vm-delimited list of files to be attached to the email. The list should contain both paths and filenames.
usernameThe username of the mail account.
passwordThe password of the mail account.

See also

Socket Functions

Example

Declare Function SENDMAIL, Msg
mailservername = "my.mailserver.net"
Sendername = "info@revelation.com"
Recipient  = "someone@somewhere.com"
Subject = "An Example of the OpenInsight SENDMAIL Function"
Body = ."A line of text."
CC = ""
BCC = ""
replyto = ""
content = ""
attachmentfilelist = 'C:\TEMP\myfile.txt' :@vm: 'C:\MY_DIR\ano_file.txt'
username = ""
password = ""
 
retval = sendmail(mailservername, sendername, recipient, subject, body, cc, bcc, replyto, content,attachmentfilelist, username, password)
Convert @vm To '-' In retval
Convert @fm To '|' In retval
x = Msg(@Window, 'Retval was |':retval)
  • No labels