|
-
Nov 9th, 2006, 05:06 AM
#1
Thread Starter
New Member
[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);
-
Nov 10th, 2006, 07:37 AM
#2
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?
-
Nov 10th, 2006, 08:10 AM
#3
Thread Starter
New Member
Re: [1.0/1.1] can not send email to hotmail
Yes i have checked the spam but no mail.
-
Nov 10th, 2006, 09:10 AM
#4
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.
-
Nov 10th, 2006, 09:37 AM
#5
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.
-
Nov 10th, 2006, 11:02 AM
#6
Thread Starter
New Member
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
-
Nov 14th, 2006, 08:35 AM
#7
Member
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.
-
Dec 12th, 2006, 07:31 AM
#8
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|