I found that Hotmail is not supported now (I hope I understand it wrong ?) Outlook, outlookexpress and other clients have sent and received emails.
However, I still want to stick to my attitude towards technological learning.
CoreCodeAs follows:
Public Void Sendmail ( String From, String Fromname, String To, String Subject, String Body, String Username, String Password)
{
// We begin by setting up a quote string (used later) as well generating a mail time stamp:
// Quote character.
String Quote = " \ U0022 " ;
// Generate the time stamp.
Datetime now = Datetime. now;
String Timestamp = Now. tostring ( " DDD, DD Mmm yyyy hh: mm: SS " );
// The httpmail Protocol follows an SMTP-like communication scheme (see RFC 821). Outlook Express sends out mail in MIME format, but for demonstrations purposes we simply send a plain text E-mail:
// Build the post body.
String Postbody = Null ;
// Dump mail headers.
Postbody + = " Mail from: < " + From + " > \ R \ n " ;
Postbody + = " Rcpt to: < " + To + " > \ R \ n " ;
Postbody + = " \ R \ n " ;
Postbody + = " From: " + Quote + Fromname + Quote + " < " + From + " > \ R \ n " ;
Postbody + = " To: < " + To + " > \ R \ n " ;
Postbody + = " Subject: " + Subject + " \ R \ n " ;
Postbody + = " Date: " + Timestamp + " -0000 \ n " ;
Postbody + = " \ R \ n " ;
// Dump mail body.
Postbody + = Body;
// To send the mail, we need to set the Content-Type request header to message/rfc821, indicating that this request contains a body which follows RFC 821. we post the Request body generated abve to the sendmsg URL obtained during connection time:
XMLHTTP _ = New XMLHTTP ();
// Open the connection.
XMLHTTP _. Open ( " Post " , Serverurl, False , Username, password );
// Send the request.
XMLHTTP _. setRequestHeader ( " Content-Type " , " Message/rfc821 " );
XMLHTTP _. Send (postbody );
MessageBox. Show (XMLHTTP _. statustext ); // XMLHTTP _. responsetext;
}
In the last line, the original code uses XMLHTTP _. responsetext to read no data, but uses statustext to receive the Hotmail response:---------------------------
Access to Hotmail via Outlook and Outlook Express now requires a submodules. Please sign up at http://upgrade.msn.com
---------------------------
Of course, there are other alternatives for you to use hotmail to send emails ....