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