How to send an email with ASP JMAIL?

zhaozj2021-02-16  75

<%

Set msg = server.createObject ("jmail.message")

msg.silent = true

Msg.logging = true

msg.charset = "GB2312"

Msg.mailServerUserName = "user@yourdomain.com" 'Enter SMTP server verification login name (any of the email address of any of the post office)

Msg.mailServerPassword = "userpasswd" "Enter the SMTP server to verify password (the password corresponding to the user email account)

Msg.From = Request.form ("email") 'sender Email

msg.fromname = request.form ("name") 'sender name

Msg.addrecipient "Webmaster@abc.com" 'Recipient Email

msg.subject = Request.form ("Subject") 'Letter Theme

Msg.body = request.form ("body") 'body

Msg.send ("mail.yourdomain.com") 'SMTP server address (enterprise post office address)

SET MSG = Nothing

%>

Or: txt = txt & "Tel: 028-88077421
" TXT = TXT & "QQ: 17708515 597341 (Both mobile phone SMS)
" "The above is the text set jmail = server.createObject (" Jmail.smtpmail ") jmail.serveraddress =" localhost "" Specifies the server address of the message Jmail.AddRecipient Request ("email") 'Recipient address, here is obtained from the form, of course, can be replaced with other addresses: Such as jmail.addrecipient "Webmaster@33333.com" jmail.subject = "Western digital virtual host open trial notification!" 'Mail Topic JMail.Body = TXT' Mail Text Jmail.conteType = "Text / HTML" "Specified HTML Format The mail jmail.sender = "Webmaster@west263.com" 'sender, must be the name of the mailbox in this mail system, otherwise it cannot be sent successfully! Jmail.Priority = 2 'priority jmail.execute set jmail = Nothing

For details, please download the demo file: http://www.west263.com/formjmail.rar

转载请注明原文地址:https://www.9cbs.com/read-15190.html

New Post(0)