A pointer variable containing the message with the following properties:
The sender's email address.
The sender's name.
The recipient list. Multiple entries are separated by commas. Microsoft Outlook allows you to format the address as "recipient_name". This hides the "" portion of the field from the recipient.
The CC list. Multiple entries are separated by commas.
Specifies the character set you want to use, ex. UTF8.
The BCC list. Multiple entries are separated by commas.
The subject line of the email.
The body of a text message.
The body of a HTML message.
A semi-colon (;), comma, or CR-LF delimited list of filenames.
Default = NULL. The sending email program.
Default = .F.. If .T. = Attachments are embedded image in the HTML message. If .F. = Attachments are separate files.
Default = .F. (Requires V8, addin build 3090 or later). If .t. then an e-mail will be sent to the sender acknowledging that the recipient has read the e-mail. Note that not all e-mail clients support this feature and the recipient might decline to send the receipt.
Default = "". Optional email headers. Email headers are specified as a CR-LF delimited list of colon separated name-value pairs. Headers can be one of the standard mail headers or a user-defined header. Prefix user-defined headers with "X-".
dim headers as c =<<%str% Reply-To: firstname.lastname@example.org X-company: Example Co X-campaign: Spring Launch %str%
See RFC 822 to learn more about message headers.The support of an email header is dependent on the email client. Some email clients may not support the header(s) you include in the message.
A pointer variable that is populated by EMAIL_SMTP_OPEN().
Default = .F. Whether to show a progress meter or not. .T. = Show a progress meter. .F. = Do not show a progress meter.
Default = .T. Whether to force text emails to wrap at 72 characters per line. .T. = Automatically wrap all lines of text at 72 characters or less. .F. = Leave text email body unchanged.
Returns .T. if the message was sent successfully. Returns .F. if the message was not sent.
The EMAIL_SMTP_SEND() function sends a message through a SMTP mail server. This function, along with EMAIL_SMTP_OPEN()and EMAIL_SMTP_CLOSE(), will allow you to send email from a computer that does not have an Alpha Anywhere email profile.
DIM pm as P pm.from = "email@example.com" pm.from_alias = "Aaron Brown" pm.to = "firstname.lastname@example.org" pm.cc = "email@example.com" pm.bcc = "firstname.lastname@example.org pm.subject = "This is a test" pm.message = "This is the body of the message" pm.html_message = "HTML Body goes here pm.attachments = <<%str% C:\dev\test.zip C:\my documents\report.zip %str% 'optional header fields pm.xmailer = "Alpha Mailer" pm.lRelated = .F. 'optional email headers pm.headers = <<%txt% X-Company: Alpha Software X-Location: Boston X-CodeExample: Sending Email with Xbasic Reply-To: email@example.com %txt% ' send message dim ps as P if (email_smtp_open(ps, "mail.alphasoftware.com", 25, "username", "password")) THEN if (email_smtp_send(pm, ps)) then TRACE.writeLn("Email sent","Email Log") else TRACE.writeLn("Could not send email","Email Log") end if else TRACE.writeLn("Could not connect to SMTP server","Email Log") END IF email_smtp_close(ps)
You can specify the character set when using the email_smtp_send() function.
DIM pm as P pm.from = "firstname.lastname@example.org" pm.from_alias = "Aaron Brown" pm.to = "email@example.com" pm.subject = "This is a test" ' Text that contains non ascii characters - encoded as UTF8 pm.message = convert_acp_to_utf8("même manière") ' Indicate that we want to send the text with 'utf8' encoding pm.charset = "utf8" DIM ps as P if (email_smtp_open(ps, "mail.alphasoftware.com", 25, "username", "password")) then if (email_smtp_send(pm, ps)) then TRACE.writeLn("Email sent","Email Log") else TRACE.writeLn("Could not send email","Email Log") end if else TRACE.writeLn("Could not connect to SMTP server","Email Log") end if email_smtp_close(ps)