smtp1 = 0;
smtp_logon_ex(&smtp1, "SmtpLogon",
"URL=smtp://smtp.163.com",
"CommonName=LoadRunner User",
LAST);
smtp_logon_ex(&smtp1, "SmtpLogon",
"URL=smtp://smtp.163.com",
"CommonName=LoadRunner User",
LAST);
smtp_free_ex(&smtp1);
smtp2 = 0;
smtp_logon_ex(&smtp2, "SmtpLogon",
"URL=smtp://smtp.163.com",
"LogonUser=yhgl_soft@163.com",
"LogonPass=abcdef", 密码
"CommonName=LoadRunner User",
LAST);
smtp_logon_ex(&smtp2, "SmtpLogon",
"URL=smtp://smtp.163.com",
"LogonUser=yhgl_soft@163.com",
"LogonPass=abcdef", 密码
"CommonName=LoadRunner User",
LAST);
smtp_send_mail_ex(&smtp2, "SendMail",
"To=yhgl_soft@163.com",
"From=yhgl_soft@163.com",
"Subject=hi", 标题
"ContentType=text/plain;",
"charset=\"gb2312\"",
MAILOPTIONS,
"X-mailer: Foxmail 5.0 [cn]",
MAILDATA,
"MessageText=你好hi yuy\r\n", 内容
LAST);
"To=yhgl_soft@163.com",
"From=yhgl_soft@163.com",
"Subject=hi", 标题
"ContentType=text/plain;",
"charset=\"gb2312\"",
MAILOPTIONS,
"X-mailer: Foxmail 5.0 [cn]",
MAILDATA,
"MessageText=你好hi yuy\r\n", 内容
LAST);
smtp_logout_ex(&smtp2);
smtp_free_ex(&smtp2);
return 0;
本文转自 fish_yy 51CTO博客,原文链接:http://blog.51cto.com/tester2test/139575,如需转载请自行联系原作者