Jmail email sending code

Source: Internet
Author: User
On Error resume next
Dim jmail, contentid
Set jmail = server. Createobject ("jmail. Message ")
Jmail. charset = "gb2312" 'mail character set, "US-ASCII" by default"
'Jmail. isoencodeheaders = false' indicates whether to perform ISO encoding. The default value is true.

'Sender information (assign values using variables)
Jmail. From = "goaler@goalerCN.com" 'sender address
Jmail. fromname = "goaler" 'sender name
Jmail. Subject = "automatically sent by jmail" 'subject

'Authentication
Jmail. mailserverusername = "goaler@goalerCN.com" 'user name for authentication
Jmail. mailserverpassword = "***********" 'authentication Password

'Set the priority, range from 1 to 5. The higher the priority, the higher the 3 is normal.
Jmail. Priority = 3

Jmail. addheader "originating-IP", request. servervariables ("remote_addr ")

'Add one recipient [variable Email: Recipient address] multiple recipients can be added in the same statement
Friendemail = "user@163.com" 'recipient email address
Jmail. addrecipient (friendemail)

'Add the attachment [variable filename: the absolute address of the attachment file to ensure that the user's IUSR _ machine name has access permissions]
'[Whether the parameter is set to (true) or not (false) as the inline method]
'Contentid = jmail. addattachment (server. mappath ("jmail. asp"), true)

'Subject (HTML (note the attachment Link Method in the letter ))
Mailbody = mailbody & "<HTML> Mailbody = mailbody & "email content"
Mailbody = mailbody & "</body> Jmail. htmlbody = mailbody

'Subject (text part)
Jmail. Body = "our emails are in HTML format, but your email viewing software may not support it... "

'Send [Call format: objjmail. Send ([Username: password @] smtpserveraddress [: Port])]
'Jmail. Send ("mail.guxido.com ")
Jmail. Send ("mail.goalercn.com ")

'Close and clear the object
Jmail. Close ()
Set jmail = nothing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.