Results 1 to 8 of 8

Thread: [1.0/1.1] can not send email to hotmail

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    11

    [1.0/1.1] can not send email to hotmail

    I am unable to send email to hotmail but i am able to send mail to all other mailing address.please solve my problem.I dont get any error its just i canot recieve email in hotmail.this is my code


    MailMessage objMailMessage=new MailMessage();

    objMailMessage.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1 );
    objMailMessage.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername","[email protected]" );
    objMailMessage.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword","password" );

    objMailMessage.To=txtFriendsEmail.Text;
    objMailMessage.From="[email protected]";
    objMailMessage.Subject="subject"
    MailMessage.BodyFormat=MailFormat.Html;
    objMailMessage.Body="here is my message body"
    SmtpMail.SmtpServer="localhost";
    SmtpMail.Send(objMailMessage);

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [1.0/1.1] can not send email to hotmail

    No help I'm afraid but just letting you know I've had exactly the same problem. Have you checked hotmail's spam folder?

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    11

    Re: [1.0/1.1] can not send email to hotmail

    Yes i have checked the spam but no mail.

  4. #4
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [1.0/1.1] can not send email to hotmail

    I can only presume hotmail doesn't like the domain the mail is coming from. When this happened to me mail was recieved my googlemail, yahoo mail etc just not hotmail.

    When i moved to the deployment server though everyone was ok.

  5. #5
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: [1.0/1.1] can not send email to hotmail

    If you put the Send() in the Try block, check for the exception message. It should be something like "Could not access CDO.Message object". It happens usually if you use Localhost as your host.

    You would have to add the Microsoft CDO for Windows 2000 Library reference. Check post number 7 in this thread - MSDN Forums.

    EDIT: Forgot to add, this problem is quite persistent in VS 2003, and I have never succeeded in sending mail to myself (regardless of hotmail) using the same method you have posted.

    Also check this link - www.systemwebmail.com
    Last edited by Harsh Gupta; Nov 10th, 2006 at 09:41 AM.
    Show Appreciation. Rate Posts.

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    11

    Re: [1.0/1.1] can not send email to hotmail

    but this wont work on all the windows.if the server doesnot have windows2000 then this solution wont work

  7. #7
    Member
    Join Date
    Mar 2006
    Posts
    58

    Re: [1.0/1.1] can not send email to hotmail

    I had the same problem. I cant remember the exact error, but it was something to the effect of a relay, which hotmail blocks because of spam.

  8. #8
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [1.0/1.1] can not send email to hotmail

    i've had this problem before, and i managed to solve it by adding in some specific e-mail headers.
    E-mail sent without these headers was being sent straight to my hotmail spam box.

    here is some sample code (mail server and e-mail addresses modified) that i used to send an email to hotmail using mono/.net 1.1:

    PHP Code:
    using System;
    using System.Web.Mail;

    public class 
    test
    {
        public static 
    void Main()
        {
            try
            {
                
    MailMessage msg = new MailMessage();
                
    msg.To "someone <[email protected]>";
                
    msg.From "test <[email protected]>";
                
    msg.Subject "test email";
                
    msg.Body "test email";
                
    msg.Headers.Add("Reply-To""reply-to-address");
                
    msg.Headers.Add("MIME-Version""1.0");
                
    msg.Headers.Add("X-Priority""3 (Normal)");
                
    msg.Headers.Add("Content-Type""text/plain;charset=iso-8859-1");
                
    msg.Headers.Add("Content=Transfer-Encoding""8bit");
                
    SmtpMail.SmtpServer "mail.server";
                
    SmtpMail.Send(msg);
            }
            catch (
    Exception ex)
            {
                
    Console.WriteLine(ex.Message);
            }
        }

    (the PHP tags are just for code formatting... it's still C# code)
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width