LR录制使用foxmail发送邮件到163邮箱原始脚本

发送邮件自动化脚本实现
本文介绍了一段使用LoadRunner实现的SMTP邮件发送自动化脚本,包括登录、发送邮件及附件、并进行邮件主题和内容的设置。

Action部分

Action()
{

	smtp1 = 0;
	smtp_logon_ex(&smtp1, "SmtpLogon", 
		"URL=smtp://smtp.xxx.com", 
		"LogonUser=xxx@xxx.com", 
		"LogonPass=xxxxxx", 
		"CommonName=LoadRunner User", 
		LAST);

	smtp_send_mail_ex(&smtp1, "SendMail", 
		"To=wwwwww@163.com", 
		"From=<xxx@xxx.com> SIZE=1544903", 
		"Subject==?gb2312?B?0ru34rLiytTTyrz+IGZvcjE2M9PKz+Q=?=", 
		"ContentType=multipart/mixed;", 
		MAILOPTIONS, 
			"From: xxx <xxx@xxx.com>", 
			"To: wwwwww<wwwwww@163.com>", 
			"Reply-To: xxx<xxx@xxx.com>", 
			"X-Priority: 3", 
			"X-Has-Attach: yes", 
			"X-Mailer: Foxmail 7.0.1.92[cn]", 
		MAILDATA, 
			"AttachRawFile=mailnote1_01.dat", 
			"AttachRawFile=mailnote1_02.dat", 
		LAST);

	//lr_think_time(16);

	smtp_logout_ex(&smtp1);

	smtp_free_ex(&smtp1);

	return 0;
}

globals_h部分

#ifndef _GLOBALS_H 
#define _GLOBALS_H

//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "mic_smtp.h"

//--------------------------------------------------------------------
// Global Variables
SMTP smtp1;

#endif // _GLOBALS_H

mailnote1_01.dat为主题部分。内容略

mailnote1_02.dat为附件部分。内容略



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值