\x0d\x0a
\x0d\x0a\x0d\x0aCC:抄送地址;
\x0d\x0a\x0d\x0aBCC:密件抄送地址;
\x0d\x0a\x0d\x0aSubject:主题;
\x0d\x0a\x0d\x0aBody:邮件内容。
\x0d\x0a\x0d\x0a注:多个邮件地址用""隔开。
SmtpClient_smtpClient=newSmtpClient()\x0d\x0a_smtpClient.DeliveryMethod=SmtpDeliveryMethod.Network//指定电子邮件发送方式\x0d\x0a_smtpClient.Host=strHost//指定SMTP服务器\x0d\x0a_smtpClient.Credentials=newSystem.Net.NetworkCredential(strAccount,strPwd)//用户名和密码\x0d\x0aMailMessage_mailMessage=newMailMessage(strFrom,mailto)\x0d\x0a_mailMessage.Subject=subject//主题\x0d\x0a_mailMessage.Body=body//内容\x0d\x0a_mailMessage.BodyEncoding=System.Text.Encoding.UTF8//正文编码\x0d\x0a_mailMessage.IsBodyHtml=true//设置为HTML格式\x0d\x0a_mailMessage.Priority=MailPriority.High//优先级\x0d\x0atry\x0d\x0a{\x0d\x0a_smtpClient.Send(_mailMessage)\x0d\x0areturntrue\x0d\x0a}\x0d\x0acatch\x0d\x0a{\x0d\x0areturnfalse\x0d\x0a}\x0d\x0a你可以试试!**subject: 要发送的邮件主题*/function SendEMail(infor, subject){var jMail = new ActiveXObject("Jmail.message")jMail.Silent = truejMail.Charset = "utf-8"jMail.FromName = "sender" //发件人jMail.From = "anxingyu_1984@126.com"//发送人的邮件地址jMail.AddRecipient("axy_1984@126.com")//收件人的邮件地址// jMail.Subject = subject// jMail.Body = inforjMail.Subject = "test"jMail.Body = "tests"jMail.MailServerUserName="anxingyu_1984@126.com"jMail.MailServerPassWord="密码"var ret = jMail.Send("smtp.126.com")if(ret == false){alert("fail")}else{alert("success")}jMail.Close()}</script</BODY</HTML注册组件:jmail.dll jmail组件,版本:4.4,安装方法:将其复制到system32目录下,在MS-DOS下执行regsvr32 Jmail.dll即可网上下了个包,提供了很多组件,运行aaaa.bat即可,aaaa 只注册JMail.dll希望能解决您的问题。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)