String ls_charset, t_error
Ls_charset='GB2312'
Oleobject jmail
Jmail=Create OLEObject
Jmail. ConnectToNewObject (" Jmail. The Message ")
Jmail. Charset=ls_charset
Jmail. ISOEncodeHeaders=True
Jmail. Silent=True
Jmail. Logging=True
Jmail. From=//the sender email address
Jmail. FromName=//the sender
Jmail theme Subject=//
Jmail. MailServerUserName=//user name
Jmail. MailServerPassword=//the user password
Jmail. Priority=3
Jmail. AddRecipient (" 546764 @qq.com ")//recipient mailbox
Jmail. Body="disconnect" + "~ r ~ n//email content
IF Jmail. Send (" smtp.XXXXXX.com ") THEN//to Send a mail server
Messagebox (' prompt ', "send success!" )
Jmail. Close ()
Destroy Jmail
Close (the Parent)
The ELSE
T_error=jmail. Errormessage ()
Messagebox (' prompt ', "send failed!" + t_error)
Jmail. Close ()
Destroy Jmail
END the IF
CodePudding user response:
Error sources: jmail. MessageError description: The message was undeliverable. All servers failed to receive The message
May be the cause of the problem:
1, the user name and password
In the code to write the
MSG.. MailServerUserName="user name"
MSG. MailServerPassWord="password"
Or
MSG. Send (" user name: password @ server.net ")
To write the sender's mail server connection and enter the mail server user name and password, the user name and password must exist and correct on the server, and if the user name and password had better not underlined,
2, the firewall prevents the network communication or network failure
Firewall might think this is caused by worms crazy hair mail, so will prohibit mass emails,
So check firewall Settings can be found,
3. Jmail component permissions not
4. Mail server failure
CodePudding user response:
Thanks for lzp_lrp reply, customer several reasons are listed as you 1 and 4 if there is a problem that the network should be also not line, so definitely not, as for the 2 I have also considered, but the network is I use OE tested is normal, that there should be no firewall blockCodePudding user response:
Jmail no problem, I can use network the network, estimates that you are a pop or IP problem,,, see tips should be not connected to the mail server,