Below is the snippet to be used for performance testing the SMTP server with bulk email messages or per your project needs,

 

Action()
{
// connect to smtp mail server
smtp_logon(“Logon”,
“URL=smtp://{P_userID}@mail.o365am.xxx.com:xxxx”,
“CommonName=SMTP {P_userID}”,
“LogonUser={P_LoginEmailID}”,
lr_decrypt(“5d564d6e185f6c5457b32fc024bc4a91aaacc3c”),
“STARTTLS=STARTTLS”,
LAST );

// send email
smtp_send_mail(“SendMail”,
“To={P_RecepientEmail}”,
“Cc={P_RecepientEmail}”,
“Bcc={P_RecepientEmail}”,
“From={P_LoginEmailID}”,
“Subject=Testing SMTP message from Load Runner”,
“ContentType=text/plain;”,
“charset=UTF-8”,
//     MAILOPTIONS,
//     “X-Priority: 3”,
//     “X-MSMail-Priority: Normal”,
//     “X-Mailer: Microsoft Outlook Express 5.00.2919.6700”,
//     “X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700”,
MAILDATA,
“MessageText=This is a simple mail from LR\r\n”,
LAST );

// wait time
lr_think_time(2);

// disconnect from server
smtp_logout();

return 0;
}