Loadrunner中写SMTP脚本
Action(){
smtp1 = 0;
lr_think_time(1);
lr_start_transaction("SMTP服务器登录");
smtp_logon_ex(&smtp1,"SmtpLogon",
"URL=smtp://xxxx.com",
"LogonUser={LogonUser}@joysinfo.com",
"LogonPass=test",
"CommonName=LoadRunner User",
LAST);
lr_end_transaction("SMTP服务器登录",LR_AUTO);
//邮件附件参数化
smtp_translate_ex(&smtp1,"{AttachRawFile}",
"Content-Type: application/octet-stream;\nname=\"base64_{AttachRawFile}\"\nContent-Transfer-Encoding:"
" base64\nContent-Disposition: attachment;\nfilename=\"base64_{AttachRawFile}\"\r\n",
BASE64_ENCODED,"base64_{AttachRawFile}");
lr_start_transaction("SMTP邮件发送");
smtp_send_mail_ex(&smtp1, "SendMail",
"To={toUser}", //收件人
//"Bcc=junior1@joysinfo.com",
"From=<{LogonUser}@joysinfo.com>",
"Subject={num}hi=?gb2312?B?0NTE3LLiytS9xbG+0enWpA==?=", //标题
"ContentType=multipart/mixed;",
MAILOPTIONS,
"From: {LogonUser} <{LogonUser}@joysinfo.com>",
//"To: 51568182 <51568182@qq.com>,junior1 <junior1@joysinfo.com>",
"To: {toUser_1} <{toUser}>",
"Reply-To: {LogonUser} <{LogonUser}@joysinfo.com>",
"X-Priority: 3",
"X-Has-Attach: yes",
"X-Mailer: Foxmail 7.0.1.88",
MAILDATA,
"AttachRawFile={AttachRawFile}", //附件信息
"AttachRawFile=mailnote1_01.dat",//邮件具体内容
//"AttachRawFile=mailnote1_03.dat",
LAST);
lr_end_transaction("SMTP邮件发送",LR_AUTO);
smtp_logout_ex(&smtp1);
smtp_free_ex(&smtp1);
return 0;
} :) 最好写一个详细文档上传上来呀,不然还是茫然呢,移动
页:
[1]