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 ghost on the Internet and install it.
2. find jmail. DLL (under Program Files \ dimac \ w3jmail4)
3. run Program Files \ Microsoft Visual Studio 8 \ Vc \ ildasm.exe c: \ Program Files \ dimac \ w3jmail4 \ jmail. dll/out: myjmail. dll/namespace: myjmail
cannot be generated because it does not support the "Program Files" folder in DOS, you copy it to nothing else and generate myjmail according to the above method. DLL.
4. set myjmail. dll can be referenced to your project.
Notes
| 1. user name and password
InCodeTo write
MSG .. mailserverusername = "username"
MSG. mailserverpassword = "password"
Or
MSG. Send ("User name: password @ server.net ")
The username and password of the email server to which the sender connects. The user name and password must exist on the server and be correct. It seems that the username and password should not be underlined.
2. the firewall blocks network communication or network faults
It is possible that the firewall will think this is a worm-caused mass mailing situation, so it will prohibit mass mailing.
Therefore, you may find the firewall settings.
3. The jmail component has insufficient permissions.
4. email server fault
Jmail code Myjmail. Message jmail = New Myjmail. Message ();
Jmail. contenttype = " Text/html " ;
Jmail. Silent = False ;
Jmail. Logging = True ;
Jmail. charset = " Gb2312 " ;
Jmail. addrecipient ( " Toemail " , "" , "" );
Jmail. From = " Fromemail " ;
Jmail. mailserverusername = " Username " ; // Note: The username must be full and should not be underlined.
Jmail. mailserverpassword = " Password " ; // Password with no underlines
Jmail. Subject = " Topic " ;
Jmail. Body = " Content " ;
Jmail. Send ( " Smtp.126.com " , False );
Jmail. Close ();
Note: I have uploaded the generated code for everyone to download the http://files.cnblogs.com/daxia/myJmail.rar