The Mailing Service protocols emulate a user working with an email client,
viewing and sending emails. The following mailing services are supported:
➤ Internet Messaging (IMAP)
➤ MS Exchange (MAPI)
➤ Post Office Protocol (POP3)
➤ Simple Mail Transfer Protocol (SMTP)
The mail protocols support both record and replay, with the exception of MAPI that only supports replay.
IMAP Protocol Overview:
IMAP Vuser script functions record the Internet Mail Application Protocol. Recording is not supported for this protocol. Each IMAP function begins with an imap prefix. In the following example, the imap_create function creates several new mailboxes: Products, Solutions, and FAQs
Actions()
{
imap_logon("ImapLogon",
"URL=imap://johnd:letmein@exchange.mycompany.com",
LAST);
imap_create("CreateMailboxes",
"Mailbox=Products",
"Mailbox=Solutions",
"Mailbox=FAQs",
LAST);
imap_logout();
return 1;
}
MAPI Protocol Overview:
MAPI Vuser script functions record activity to and from an MS Exchange server. Each MAPI function begins with a mapi prefix.
Note: To run MAPI scripts, you must define a mail profile on the machine running the script. For example, install Outlook Express, set it as the default mail client, and create a mail account. Alternatively, install Microsoft Outlook, set it as the default mail client, create a mail account and create a mail profile. To create a mail profile in Microsoft Outlook, select Settings > Control Panel > Mail > Show Profiles and add a mail profile.
In the following example, the mapi_send_mail function sends a sticky note through an MS Exchange server
Actions()
{
mapi_logon("Logon",
"ProfileName=John Smith",
"ProfilePass=Tiger",
LAST);
//Send a Sticky Note message
mapi_send_mail("SendMail",
"To=user1@techno.merc-int.com",
"Cc=user0002t@techno.merc-int.com",
"Subject=: @ ",
"Type=Ipm.StickyNote",
"Body=Please update your profile today.",
LAST);
mapi_logout();
return 1;
}
POP3 Protocol Overview:
POP3 Vuser script functions emulate actions using the Post Office Protocol,POP3. Each function begins with a pop3 prefix. In the following example, the pop3_retrieve function retrieves five messages from the POP3 server.
Actions()
{
pop3_logon("Login", "
URL=pop3://user0004t:my_pwd@techno.merc-int.com",
LAST);
// List all messages on the server and receive that value
totalMessages = pop3_list("POP3", LAST);
// Display the received value (It is also displayed by the pop3_list function)
lr_log_message("There are %d messages.\r\n\r\n", totalMessages);
// Retrieve 5 messages on the server without deleting them
pop3_retrieve("POP3", "RetrieveList=1:5", "DeleteMail=false", LAST);
pop3_logoff();
return 1;
}
SMTP Protocol Overview:
SMTP Vuser script functions emulate the Single Mail Transfer Protocoltraffic. Each SMTP function begins with an smtp prefix. .
In the following example, the smtp_send_mail function sends a mail
message, through the SMTP mail server, techno.
Actions()
{
smtp_logon("Logon",
"URL=smtp://user0001t@techno.merc-int.com",
"CommonName=Smtp Test User 0001",
NULL);
smtp_send_mail("SendMail",
"To=user0002t@merc-int.com",
"Subject=MIC Smtp: Sample Test",
"MAILOPTIONS",
"X-Priority: 3",
"X-MSMail-Priority: Medium",
"X-Mailer: Microsoft Outlook Express 5.50.400\r\n",
"X-MimeOLE: By Microsoft MimeOLE V5.50.00\r\n",
"MAILDATA",
"MessageText="
"Content-Type: text/plain;\r\n"
"\tcharset=\"iso-8859-1\"\r\n"
"Test,\r\n"
"MessageBlob=16384",
NULL);
smtp_logout();
return 1;
}
viewing and sending emails. The following mailing services are supported:
➤ Internet Messaging (IMAP)
➤ MS Exchange (MAPI)
➤ Post Office Protocol (POP3)
➤ Simple Mail Transfer Protocol (SMTP)
The mail protocols support both record and replay, with the exception of MAPI that only supports replay.
IMAP Protocol Overview:
IMAP Vuser script functions record the Internet Mail Application Protocol. Recording is not supported for this protocol. Each IMAP function begins with an imap prefix. In the following example, the imap_create function creates several new mailboxes: Products, Solutions, and FAQs
Actions()
{
imap_logon("ImapLogon",
"URL=imap://johnd:letmein@exchange.mycompany.com",
LAST);
imap_create("CreateMailboxes",
"Mailbox=Products",
"Mailbox=Solutions",
"Mailbox=FAQs",
LAST);
imap_logout();
return 1;
}
MAPI Protocol Overview:
MAPI Vuser script functions record activity to and from an MS Exchange server. Each MAPI function begins with a mapi prefix.
Note: To run MAPI scripts, you must define a mail profile on the machine running the script. For example, install Outlook Express, set it as the default mail client, and create a mail account. Alternatively, install Microsoft Outlook, set it as the default mail client, create a mail account and create a mail profile. To create a mail profile in Microsoft Outlook, select Settings > Control Panel > Mail > Show Profiles and add a mail profile.
In the following example, the mapi_send_mail function sends a sticky note through an MS Exchange server
Actions()
{
mapi_logon("Logon",
"ProfileName=John Smith",
"ProfilePass=Tiger",
LAST);
//Send a Sticky Note message
mapi_send_mail("SendMail",
"To=user1@techno.merc-int.com",
"Cc=user0002t@techno.merc-int.com",
"Subject=
"Type=Ipm.StickyNote",
"Body=Please update your profile today.",
LAST);
mapi_logout();
return 1;
}
POP3 Protocol Overview:
POP3 Vuser script functions emulate actions using the Post Office Protocol,POP3. Each function begins with a pop3 prefix. In the following example, the pop3_retrieve function retrieves five messages from the POP3 server.
Actions()
{
pop3_logon("Login", "
URL=pop3://user0004t:my_pwd@techno.merc-int.com",
LAST);
// List all messages on the server and receive that value
totalMessages = pop3_list("POP3", LAST);
// Display the received value (It is also displayed by the pop3_list function)
lr_log_message("There are %d messages.\r\n\r\n", totalMessages);
// Retrieve 5 messages on the server without deleting them
pop3_retrieve("POP3", "RetrieveList=1:5", "DeleteMail=false", LAST);
pop3_logoff();
return 1;
}
SMTP Protocol Overview:
SMTP Vuser script functions emulate the Single Mail Transfer Protocoltraffic. Each SMTP function begins with an smtp prefix. .
In the following example, the smtp_send_mail function sends a mail
message, through the SMTP mail server, techno.
Actions()
{
smtp_logon("Logon",
"URL=smtp://user0001t@techno.merc-int.com",
"CommonName=Smtp Test User 0001",
NULL);
smtp_send_mail("SendMail",
"To=user0002t@merc-int.com",
"Subject=MIC Smtp: Sample Test",
"MAILOPTIONS",
"X-Priority: 3",
"X-MSMail-Priority: Medium",
"X-Mailer: Microsoft Outlook Express 5.50.400\r\n",
"X-MimeOLE: By Microsoft MimeOLE V5.50.00\r\n",
"MAILDATA",
"MessageText="
"Content-Type: text/plain;\r\n"
"\tcharset=\"iso-8859-1\"\r\n"
"Test,\r\n"
"MessageBlob=16384",
NULL);
smtp_logout();
return 1;
}
2 comments:
Does the smtp protocol/function used by loadrunner abide by a different time stamp? I'm sending emails out using a script in loadrunner, and the sent time within the email is one hour off...The server has the correct time, I checked datetimestamp in loadrunner and it has the correct time...
Hi,
I have a similar requirement where I have to send a file through email.
Could you please suggest how to proceed on this requirement.
Thanks,
Surendra
Post a Comment