R
rose
Hi everyone,
I have been searching the net but couldnt find a solution to my
problem of sending emails to external domains in Asp.net 1.1.
I am not getting any error and the Mail Send message returns 1 or
success but the mail doesnt go. I am using the Mail Server as the
Companies Exchange Server which has full rights to send emails to any
domain. This is proved by the fact that if I sent email through
outlook to hotmail,gmail etc , it works fine. Also I have created a
user in the Exchange Server will full rights but still the problem
persists. I have copied my code below to give you an idea.
MailMessage objMsg = new MailMessage();
objMsg.From ="(e-mail address removed)";
objMsg.Subject = objMailDM.MailSubject;
objMsg.Body += objMailDM.MailBody;
objMsg.To ="(e-mail address removed)";
SmtpMail.SmtpServer =
ConfigurationSettings.AppSettings["MailServer"]; //this entry will go
to web.config
// set SMTP server port
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpserverport",25);
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendusing",2);
//objMsg.BodyFormat = System.Web.Mail.MailFormat.Html;
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate",1);
objMsg.Fields.Add"http://schemas.microsoft.com/cdo/configuration/
sendusername", "username");
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendpassword", "pass");
try
{
SmtpMail.Send(objMsg);
return 1;
}
I have been searching the net but couldnt find a solution to my
problem of sending emails to external domains in Asp.net 1.1.
I am not getting any error and the Mail Send message returns 1 or
success but the mail doesnt go. I am using the Mail Server as the
Companies Exchange Server which has full rights to send emails to any
domain. This is proved by the fact that if I sent email through
outlook to hotmail,gmail etc , it works fine. Also I have created a
user in the Exchange Server will full rights but still the problem
persists. I have copied my code below to give you an idea.
MailMessage objMsg = new MailMessage();
objMsg.From ="(e-mail address removed)";
objMsg.Subject = objMailDM.MailSubject;
objMsg.Body += objMailDM.MailBody;
objMsg.To ="(e-mail address removed)";
SmtpMail.SmtpServer =
ConfigurationSettings.AppSettings["MailServer"]; //this entry will go
to web.config
// set SMTP server port
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpserverport",25);
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendusing",2);
//objMsg.BodyFormat = System.Web.Mail.MailFormat.Html;
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate",1);
objMsg.Fields.Add"http://schemas.microsoft.com/cdo/configuration/
sendusername", "username");
objMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/
sendpassword", "pass");
try
{
SmtpMail.Send(objMsg);
return 1;
}