mailsender

Top  Previous  Next

o=new("mailsender",server$,port,timeout,ssl,login$,password$)

 

The mailsender  object provides functionality to send email constructed with mailmessage objects.  Like the related email and deliver commands, and the email() code block function, it supports SMTP and SMTPS servers, with or without authentication.

 

Properties

errmsg$

The last error message.

logdetail

Set to 1 to enable detailed logging to logfile$

logfile$

Sets the log file name.

login$

The SMTP user login.

password$

The SMTP user password.

port

The port to connect to, which defaults to 25 for standard SMTP, or 465 for SSL.

server$

The SMTP mail server name or IP address

ssl

Set to 1 for SMTPS (SMTP over SSL protocol)

timeout

Timeout in seconds for server communication.  Defaults to 30 seconds.

 

 

Methods

send(message[,errmsg$])

Sends the email specified, and returns true (1) on success.  If an error occurs, it returns false and sets errrmsg$ to an error message.  The message parameter must be a mailmessage object.

sendeach(message[,errmsg$])

Sends individual email messages to each To address specified in the message's "to" collection property.  This differs from the send method, which leaves multiple To recipients as a list, allowing each recipient to see the others who were addressed.  Internally, it creates a new message for each To address and uses the send method.  If all sends are successful, the method returns true (1), otherwise false (0).  The errmsg$ value will contain the error message of the last send that failed.