Use the instructions jmail

Original link: https://blog.csdn.net/mm514322307/article/details/6209066

Use the instructions jmail

 

Configure the environment: .Net Framework 1.1, Imai8.02, w3Jmail4.3

Implementation process:

Instead of using in Jmail Asp used directly Server.CreateObject ( "Jmail.Message") on it. In the .Net environment, you need to be set.

1. Install jmail4.3

2. Locate jmail.dll (Program Files / Dimac / under w3JMail4)

3. Implementation Program Files / Microsoft Visual Studio .NET / FrameworkSDK / Bin / ildasm.exe (using Visual Studio .Net 2003 command prompt),

The following format: tlbimp c: / Program Files / Dimac / w3JMail4 / jmail.dll /out:myJmail.dll / namespace: myJmail

After generating myJmail.dll, copy bin directory to the root directory of the web. In ASP.Net page, use this method references:

Jmail.aspx

<%@ Page Language="C#" ContentType="text/html"%>

<%@ Import Namespace="myJmail" %>

<script runat="server">

protected void Page_Load(Object Src, EventArgs E)

{

 

Message jmail=new Message();

jmail.From="sss";

jmail.AddRecipient("[email protected]",null,null);

jmail.MailServerUserName="brookes";

jmail.MailServerPassWord="walkor";

jmail.Subject="jmail c#";

jmail.Send("mail.lsg.com",false);

</script>

 

Tlbimp:

Microsoft .Net Framework Type Library to Assembly Converter

http://www.se360.com/eschool/20054/9306.htm

 
 

The main argument list Jmail 

-------------------------------------------------- ------------------------------
source author: Herd Popularity: 3485 

(1) Body (mail body): a string 
such as: JMail.Body = "where the user may fill out the form, may be taken from the From."

(2) Charset (character set, the default is "US-ASCII"): String 
as: JMail.Charset = "US-ASCII"

(3) ContentTransferEncoding: string 
encoding when transmitting designated content, the default is "Quoted-Printable" 
as: JMail.ContentTransferEncoding = "base64"

(4) ContentType (. Contentype letter of default is "text / plain"): String
If you send messages in HTML format, changed to "text / html" can be. 
Such as: JMail.ContentType = "text / html"

(5) Encoding: string 
disposed attachment encoding mode (default. "Base64) can choose to use the" base64 "," uuencode "or  " quoted-printable "
as: JMail.Encoding =" base64 "

(6) Log (log Jmail created, provided loging property is set to true, see below): string 
such as: use Response.Write (JMail.Log) statement lists the log information.

(7) Logging (whether logs): Boolean 
such as: JMail.Logging = true

(8) Recipients: string 
read-only property returning all recipients 
such as: Response.Write ( "" + JMail.Recipients + "");

(9) ReplyTo (return address specified otherwise): the string 
as: = JMail.ReplyTo " [email protected] "

(10) Sender (sender's e-mail address): string 
as: = JMail.Sender " [email protected] "

(11) SenderName (sender's name): string 
such as: JMail.SenderName = "one gram"

(12) ServerAddress (address of the mail server): String 
You can specify multiple servers by semicolons point. You can specify the port number. 
If serverAddress left blank, JMail will try to remote mail server, and then sent directly to the server up. 
Such as: JMail.ServerAddress = "mail.263.net.cn"

(13) Subject (the title of the message is set, can be taken from From.): String 
such as: JMail.Subject = "Feedback Form"

Accessories (14) add a file to the message 
, such as: JMail.AddAttachment ( "c: /anyfile.zip" )

(15) AddCustomAttachment (FileName, Data  )
add custom attachments. 
As: JMail.AddCustomAttachment ( "anyfile.txt", " Contents of file");

(16) AddHeader (Header, value  )
to add user-defined mail header. 
Such as: JMail.AddHeader ( "Originating-IP" , "192.168.10.10");

(17) AddRecipient (recipient): string 
such as: JMail.AddRecipient ( " [email protected] ");

(18) AddRecipientBCC (Email), blind recipients: 
as: JMail.AddRecipientBCC ( " [email protected] ");

(19) AddRecipientCC (Email), carbon copy recipient: 
such as: JMail.AddRecipientCC ( " [email protected] ")

(20) AddURLAttachment (URL, file name) 
to download and add an attachment from the url. The second parameter "document name" to specify the file name of the letters received. 
Such as: JMail.AddURLAttachment ( " http://www.chinabs.net/jmail.zip ";, "JMail")

(21) AppendBodyFromFile (file name), the text file as a mail: 
such as: JMail.AppendBodyFromFile ( "c: /anyfile.txt" )

(22) AppendText (Text) 
text letter additional content, such as increasing the greeting, or other information. 
Such as: JMail.AppendText ( "Welcome to the site!")

(23) Close (), the forced closing JMail buffer connected to the mail server: 
such as: JMail.Close ()

(24) Execute (), send messages performed 
as: JMail.Execute () 

 

Here's the code at the site forget the password, now let everyone learn to share:
  path = Server.MapPath ( "/ ImagesRF Royalty Free / logo.gif")
  the Set JMail = Server.CreateObject ( "JMail.SMTPMail")
  JMail.ContentType = "text / HTML"
  JMail.Encoding = "Base64"
  Jmail.Charset = "GB2312"
  JMail.ServerAddress = "mail.chinabs.net"
  JMail.Sender = " [email protected] "
  JMail.Subject = "issued chinabs.net give your password! "
  JMail.AddRecipient (Email)
  JMail.Body = str
  JMail.AddHeader". Originating-IP ", Request.ServerVariables (" REMOTE_ADDR ")
  JMail.AddAttachment (path)
  JMail.Execute
  JMail.Close
  the Set JMail = Nothing


:::::::: W3 Jmail Chinese instructions :::::::: 
    
W3 Jmail instructions 
jmail.smtpmail

Body: String (v3.0)
mail body text, using AppendText additional content
such as: JMail.Body = "Hello world"

Charset: String (v3.0)
character set, the default is "US-ASCII"
such as: JMail.Charset = "US-ASCII"

ContentTransferEncoding: String (v3.0)
specify the encoding time of content delivery, the default is "Quoted-Printable"
as: JMail.ContentTransferEncoding = "base64"

ContentType: String (V3.0)
. Contentype letter default is "text / plain", but can be set to other types you want.
If you send messages in HTML format, changed to "text / html" can be.
Such as: JMail.ContentType = "text / html"

DeferredDelivery: Date (v3.0)
is set to send extension if the mail server supports it, the message will be sent to this time.
Such as: (javascript) JMail.DeferredDelivery = new Date (2000, 02, 17) .getVarDate ();

Encoding: String (v3.0)
This attribute can be used to change the encoding attachments (default is "base64) can choose to use the." Base64 "," uuencode " or" quoted-printable "
as: JMail.Encoding =" base64 "

ErrorCode: Integer (v3.0)
if JMail.silent is set to true, ErrorCode contains the error code
such as: Response.Write (JMail.ErrorCode);

ErrorMessage: String (v3.0)
if JMail.silent set to true, the error message is included
, such as: Response.Write (JMail.ErrorMessage);

ErrorSource : String(v3.0)
Contains the error source if JMail.silent is set to true
如:Response.Write( JMail.ErrorSource );

ISOEncodeHeaders: Boolean (v3.0)
whether the header is encoded into iso-8859-1 default character set is true.
As: JMail.ISOEncodeHeaders = false

Lazysend: Boolean (v3.0)
This property specifies whether to wait until Jmail then return mail is transmitted, or the buffer then sends the message in the background.
However, this attribute is set, you can not control error message. 
Note: If this option is selected, the property ServerAddress invalid, lazysend inquiry will determine the mail server by dsn,
in which some settings, which may be a problem.
Such as: JMail.LazySend = true;

The Log: String (V3.0)
Jmail create a log, loging if the property is set to true
, such as: Response.Write (JMail.Log);

Logging: Boolean (v3.0)
whether the log
such as: JMail.Logging = true

MailDomain : String(v3.0)
This can be used to override the EHLO/HELO statement to your mailserver
如:JMail.Maildomain = "hello.world.com"

MimeVersion: String (v3.0)
Specifies the mime version. ? The default quot; 1.0 "
as: JMail.MimeVersion =" 1.0 "

The Priority: Integer (V3.0)
. Priority range between 1-5
. 1 high-priority emergency call some of the mailers
2 is a high priority
3 Priority Normal
4 Low Priority
5 lowest priority
, such as: JMail.Priority = 3

Recipients: String (v3.0)
read-only property returns all recipients
such as: Response.Write ( "" + JMail.Recipients + "");

ReplyTo: String (v3.0)
Specifies an optional return address
, such as: JMail.ReplyTo = " [email protected] "

ReturnReceipt: Boolean (v3.0)
Specifies whether the sender requires a return receipt default is false.
Eg: JMail.ReturnReceipt = true

Sender: String (v3.0)
Specifies the sender's e-mail address
such as: JMail.Sender = " [email protected] "

SenderName: String (v3.0)
Specifies the name of the sender
as: JMail.SenderName = "Bat man"

ServerAddress: String (v3.0)
specify the address of the mail server. You can specify multiple servers, point by semicolons. You can specify the port number.
If serverAddress left blank, JMail will try to resolve the remote mail server, and then sent directly to the server up.
Such as: JMail.ServerAddress = "mail.mydom.net; mail2.mydom.net:2500"

Silent: Boolean (v3.0)
If set to true, JMail does not throw an exception error JMail.execute () returns true or false based on the operation results
, such as: JMail.silent = true

SimpleLayout: Boolean (v3.0)
set to true, reducing the header generated by header Jmail
as: JMail.SimpleLayout = true

Subject: String (v3.0)
set the title of the message
, such as: JMail.Subject = "Dimac rocks big time !"

UsePipelining : Boolean(v3.0)
Overrides if JMail should use pipelining on a server that supports it.
如:JMail.Pipelining = false

AddAttachment (FileName, [ContentType]) (v3.0)
was added to the mail file attachments
, such as: JMail.AddAttachment ( "c: //autoexec.bat" );

AddCustomAttachment( FileName, Data )(v3.0)
添加自定义附件. This can be used to attach "virtual files" like a generated text string or certificate etc.
如:JMail.AddCustomAttachment( "readme.txt", "Contents of file" );

AddHeader (XHeader, value) (v3.0 )
add user-defined X-header to the message
, such as: JMail.AddHeader ( "Originating-IP" , "193.15.14.623");

AddNativeHeader (Header, value) (v3.0 )
was added header
as: JMail.AddNativeHeader ( "MTA-Settings" , "route");

AddRecipient (Email) (v3.0)
increase the recipient
as: JMail.AddRecipient ( " [email protected] ");

AddRecipientBCC (Email) (v3.0)
increasing blind recipients
, such as: JMail.AddRecipientBCC ( " [email protected] ");

AddRecipientCC (Email) (v3.0)
increasing the copy recipients
such as: JMail.AddRecipientCC ( " [email protected] ");

AddRecipientEx (Email, Name) (v3.0 )
increase the recipient with a name
such as: JMail.AddRecipientEx ( " [email protected] ", "Dimac INFO");

AddURLAttachment (bstrURL, bstrAttachAs, [bstrAuth ]) (v3.0)
downloaded attachment from a url and add a second parameter "AttachAs", is used to specify the file name of the mail received. 3 optional parameter is used to identify WWW- optional.
as: JMail.AddURLAttachment ( " http://download.dimac.net/jmail/jmail.exe ";, "jmail.exe")

AppendBodyFromFile (FileName) (v3.0)
the contents of a document appended to the text
, such as: JMail.AppendBodyFromFile ( "c: //mytext.txt" );

AppendText (Text) (v3.0)
append message body content
such as: JMail.AppendText ( "Text appended to message Body");

ClearAttachments () (v3.0)
to clear the list of attachments
, such as: JMail.ClearAttachments ();

ClearCustomHeaders () (v3.0)
clear all custom header
as: JMail.ClearCustomHeaders ();

ClearRecipients () (v3.0)
to clear the list of recipients
, such as: JMail.ClearRecipients ();

Close () (v3.0)
forcibly closed JMail buffer connected to the mail server
, such as: JMail.Close ();

Boolean (v3.0): Execute ()
transmits an execution message
such as: JMail.Execute ();

ExtractEmailAddressesFromURL (bstrURL, [bstrAuth]) (v3.0)
was added from a url email address and downloads
such as: JMail.ExtractEmailAddressesFromURL ( " http://duplo.org/generateEmailList.asp ";);

GetMessageBodyFromURL (bstrURL, [bstrAuth]) (v3.0)
clears the text message, and replaced with the contents of the url. Contenttype automatically set to contentyp URl of. The second parameter (login and password) is optional.
Such as: JMail.GetMessageBodyFromURL ( " http://duplo.org/ ";, "Login: password")

LogCustomMessage (the Message) (V3.0)
. When a user-defined message is added JMail log loging only attribute is set to true, this feature works
as: JMail.LogCustomMessage ( "Hello world") ;

Guess you like

Origin blog.csdn.net/zidielang/article/details/102770806