MailSend

 

Sends an email.

 

int @MailSend(string mail_server, string username, string password, int ssl, string mail_to, string mail_from, string title, string text, int text_format, string filename);

 

Parameters

string mail_server: The mail server name used for sending emails.

string username: The username for the mail server.

string password: The password for the mail server.

int ssl: SSL security usage for sending email; 0 = No, 1 = Yes (Port = 25)

(From version 10.3.6.16 onwards, 2, 3, 4, ... can be used to specify the SMTP port number when using SSL.)

(For versions 10.3.6.16 and later, refer to Example 2.)

string mail_to: The recipient's email address.

string mail_from: The sender's email address.

string title: The subject of the email.

string text: The body of the email.

int text_format: The format of the body (0 = Text Format, 1 = HTML Format)

string filename: The attachment file name.

 

Return Value

Returns 1 for success and 0 for failure.

 

Examples

Example 1

retn = @MailSend("mail.autobase.biz", "username", "password", 0, "test@test.co.kr", "send@test.co.kr", "Mail Test by autobase script", "Hello", 0, "c:\\keypro_log.txt");

if(retn == 1) {
   @MessageBox("Mail successfully sent.", "O.K", MB_OK);
}
else {
   error = @GetLastError();
   @MessageBox(error, "Fail", MB_OK);
}

 

Description: Sends an email to test@test.co.kr.

 

Example 2

retn = @MailSend("mail.autobase.biz", "username", "password", 587, "test@test.co.kr", "send@test.co.kr", "Mail Test by autobase script", "Hello", 0, "c:\\keypro_log.txt");

if(retn == 1) {
   @MessageBox("Mail successfully sent.", "O.K", MB_OK);
}
else {
   error = @GetLastError();
   @MessageBox(error, "Fail", MB_OK);
}

 

Description: Sends an email to test@test.co.kr with SSL applied by specifying SMTP Port 587.

 

Version Information

Supported Version: 10.2.6 or Higher

 

Related Helps

@ImageListAdd()

@ImageListNew()

@ImageListSetSize()