如何使用ASP通过Jmail发送邮件
1.使用你的电子邮件服务器作为SMTP,比如mail.webweb.com, 这个要看你的邮件服务提供商的设置。
2.设定SMTP服务器验证
3.确保您的“发件人”地址和smtp登陆地址是完全一样的
例子︰
<%
dim SMTP_user
dim SMTP_password
dim SMTP_server
SMTP_user = "youremail@YourDomain.com"
SMTP_password = "yourEmailPassword"
SMTP_server = "mail.YourDomain.com"
dim client_content
client_content = "This is the test mail by using Jmail"
dim mail_to
dim mail_to_subject
dim mail_to_content
mail_to = SMTP_user
mail_to_subject = "Emailing sample with Jmail via ASP"
mail_to_content = "Content : " + client_content
dim myMail
Set myMail = Server.CreateObject("Jmail.Message")
myMail.silent = true
myMail.Logging = true
myMail.Charset = "utf-8"
myMail.ContentType = "text/html"
myMail.MailServerUserName = SMTP_user
myMail.MailServerPassword = SMTP_password
myMail.From = SMTP_user
myMail.FromName = SMTP_user
myMail.AddRecipient mail_to
myMail.Subject = mail_to_subject
myMail.Body = mail_to_content
myMail.Send SMTP_server
set myMail = nothing
response.write "Sent ok, please check" + mail_to
%>
2.设定SMTP服务器验证
3.确保您的“发件人”地址和smtp登陆地址是完全一样的
例子︰
<%
dim SMTP_user
dim SMTP_password
dim SMTP_server
SMTP_user = "youremail@YourDomain.com"
SMTP_password = "yourEmailPassword"
SMTP_server = "mail.YourDomain.com"
dim client_content
client_content = "This is the test mail by using Jmail"
dim mail_to
dim mail_to_subject
dim mail_to_content
mail_to = SMTP_user
mail_to_subject = "Emailing sample with Jmail via ASP"
mail_to_content = "Content : " + client_content
dim myMail
Set myMail = Server.CreateObject("Jmail.Message")
myMail.silent = true
myMail.Logging = true
myMail.Charset = "utf-8"
myMail.ContentType = "text/html"
myMail.MailServerUserName = SMTP_user
myMail.MailServerPassword = SMTP_password
myMail.From = SMTP_user
myMail.FromName = SMTP_user
myMail.AddRecipient mail_to
myMail.Subject = mail_to_subject
myMail.Body = mail_to_content
myMail.Send SMTP_server
set myMail = nothing
response.write "Sent ok, please check" + mail_to
%>
浙公网安备 33010602011771号