2,722
社区成员
发帖
与我相关
我的任务
分享
Set Library To myFll
Local hSmtp
hSmtp = SmtpCreate() &&创建句柄
SmtpNewMail(hSmtp,"木瓜<abc@163.com>","gates@gates.com","邮件主题","这是邮件内容啦")&&创建邮件
if not SmtpSend(hSmtp,"smtp.163.com","abc","password") &&开始发送
?"发送失败,错误信息为:"
??SmtpGetLastError(hSmtp)
endif
SmtpClose(hSmtp) &&断开句柄
Set Library To
*示例2:发送一封html格式的邮件,同时发送给两个人,带两个附件
Set Library To myFll
Local hSmtp,cHtmlBody
hSmtp = SmtpCreate(.T.) &&创建句柄,指定要使用html格式
cHtmlBody="<html><body>这是个html格式的邮件<b>Hello world!</b></body></html>" &&这是邮件内容
SmtpNewMail(hSmtp,"abc@163.com","gates@gates.com,abc@163.com","邮件主题",cHtmlBody,"myfll.fll|c:\boot.ini")&&邮件发送给了两个人,带了两个附件。
if not SmtpSend(hSmtp,"smtp.163.com","abc","password") &&开始发送
?"发送失败,错误信息为:"
??SmtpGetLastError(hSmtp)
endif
SmtpClose(hSmtp) &&断开句柄
Set Library To