Some time ago there was a simple JMail e-mail sent the code, today, the code to make a specific note, and add two other formats of code, with a few simple examples:The first is the core code of Jmail.smtpmail: Set jmail = Server.CreateObject (" JMail. SmtpMail ") ' Creates a JMail object Jmail.silent = True '
Jmail|jmail
Cdonts
Set Cdomail = Server.CreateObject ("CDONTS. NewMail ")" Create mail objectCdomail. Subject = "Mail Subject" ' Message headersCdomail. from = "Sender ' s Mail" ' sender's addressCdomail. to = "Email would from" ' Recipient's addressCdomail. BODY = contents of mail bodyCdomail. Send ' performs sending%>
This method of sending mail is the simplest
Let's introduce the format first.
The code is as follows
Copy Code
$Jmail = new COM ("Jmail.message"); Instantiate a JMail object$Jmail->silent=true; When set to True JMail does not prompt for error only returns true and False$Jmail->logging = fal
Note: For more information, see jmail instructions. I think this is enough. Don't ask me if you have any questions. For server reasons, I only use cdonts to send emails, sorry... (1) Body (letter body): String For example, jmail. Body = "the content of the Form filled by the user can be taken from. " (2) charset (character set, default: "US-ASCII"): String Example:
Some time ago has sent a simple jmail mail email code, today this code to make a specific annotation, and add two other formats of code, with a few simple examples:
The first is Jmail.smtpmail's core code:
Set JMail = Server.CreateObject ("JMail. SmtpMail ")" Creates a JMail
Some time ago has sent a simple jmail mail email code, today this code to make a specific annotation, and add two other formats of code, with a few simple examples:
The first is Jmail.smtpmail's core code:
Set JMail = Server.CreateObject ("JMail. SmtpMail ")" Creates a JMail
= "here is the title"; // mail titleJmessage. addrecipient ("master@gmail.com", "", ""); // It is the recipient's address, and the following two parameters can be blank!
// Addrecipient (emailaddress, recipientname, pgpkey)// Add a recipient to the email. Recipientname and pgpkey are optional, recipientname is the recipient's name, and pgpkey is encrypted to the email.
Jmessage. Body = "this is the mail co
recent projects require sending emails. jmail has not been used for a long time and is not officially supported by jmail. net version, so some problems are encountered, to avoid detours and write down the following content, my jmail version is 4.3 you need to extract jmail in. 1. download jmail4.3 and search for the
. Createobject ("jmail. Message ")'Whether to encode the header into the iso-8859-1 character set. The default is trueJmail. isoencodeheaders = true'If jmail. Silent is set to true, errorcode contains the error codeJmail. Silent = true'Set the title and content encoding. If the title has Chinese characters, you must set the encoding to gb2312.Jmail. charset = "gb
Sub Sendmail (mail_to, mail_subject, mail_body)
'On error resume next
Dim jmail
Userip = request. servervariables ("http_x_forwarded_for ")
If userip = "" Then userip = request. servervariables ("remote_addr") 'get the real IP Address
Set jmail = server. Createobject ("jmail. Message ")
Jmail. Silent = true
Jmail and jmail tools
I haven't updated my blog for a long time. It's really a serious procrastination. It's terrible. Update a tool class first. I wrote a tool for sending emails. I don't need to talk much about the code.
Import lombok. extern. slf4j. slf4j; import java. util. properties; import javax. mail. *; import javax. mail. internet. addressException; import javax. mail. internet. internetAddress; i
function Sendmail (mailtoaddress, mailtoname, subject, mailbody, fromname, mailfrom) 'function parameter description (recipient address, Recipient Name (optional), topic, mail content, sender name (optional), sender address) 'on error resume next dim jmail, MailServer, flag set jmail = server. createobject ("jmail. message ") If err then Sendmail = false e
It is very simple. For more information, see the example below.
1
Jmail. Message jmail
=
New
Jmail. Message ();
2
3
Jmail. Silent
=
True
;
4
Jmail. Logging
=
True
;
5
Jmail. charset
Currently, most emails require stmp authentication,. NetSystem. Web. utilSystem. Web. MailNo.I write this articleArticleI hope it will help you with your development projects.
Find a component namedJmail You can find it online, download it, and install it.Reference jmail. DLL to the Project
Figure 1:
Private void button#click (Object sender, system. eventargs E){Jmail. Message
A new jmail (version 4.3) sends codeKarry
This section of code involves most of the common methods of jmail v4.3. This includes basic email information, identity verification, and attachments. You can use it without many modifications, or change it to a function or process.Dim jmail, contentidSet
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.