sending email please somebody help Im confuseed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi I have this code
MailMessage objEmail = new MailMessage();

objEmail.To = "(e-mail address removed)";

objEmail.From = "(e-mail address removed)";

objEmail.Cc = "(e-mail address removed)";

objEmail.Subject = "Test Email";

objEmail.Body = "test" ;

objEmail.Priority = MailPriority.High;


//SmtpMail.SmtpServer =Request.ServerVariables["SERVER_NAME"].ToString() ;

try

{


SmtpMail.SmtpServer = "localhost"; //127.0.0.1 works too

SmtpMail.Send(objEmail);

Response.Write("Your Email has been sent sucessfully -Thank You");

}

catch (Exception exc)

{

Response.Write("Send failure: " + exc.ToString());

}

and in iis I set relay for 127.0.0.1 and Allow all computers which
successfully authenticate to relay

and the IPaddress is all assigne if I change it to my ip addrees IOll have
this error

The transport failed to connect to the server.
ohter wise it doisent show any error and dosent sent any thing whats wrong?

Regards
 
dear mahsa!

I get the same answer when I do this in VB. I'm using objects
CDO.Message and CDO.Configuration. What objects do you use?


Henrik
Do you have the mail server set up?

:


hi I have this code
MailMessage objEmail = new MailMessage();

objEmail.To = "(e-mail address removed)";

objEmail.From = "(e-mail address removed)";

objEmail.Cc = "(e-mail address removed)";

objEmail.Subject = "Test Email";

objEmail.Body = "test" ;

objEmail.Priority = MailPriority.High;


//SmtpMail.SmtpServer =Request.ServerVariables["SERVER_NAME"].ToString() ;

try

{


SmtpMail.SmtpServer = "localhost"; //127.0.0.1 works too

SmtpMail.Send(objEmail);

Response.Write("Your Email has been sent sucessfully -Thank You");

}

catch (Exception exc)

{

Response.Write("Send failure: " + exc.ToString());

}

and in iis I set relay for 127.0.0.1 and Allow all computers which
successfully authenticate to relay

and the IPaddress is all assigne if I change it to my ip addrees IOll have
this error

The transport failed to connect to the server.
ohter wise it doisent show any error and dosent sent any thing whats wrong?

Regards
 
I use smtp

Henrik Bergman said:
dear mahsa!

I get the same answer when I do this in VB. I'm using objects
CDO.Message and CDO.Configuration. What objects do you use?


Henrik
Do you have the mail server set up?

:


hi I have this code
MailMessage objEmail = new MailMessage();

objEmail.To = "(e-mail address removed)";

objEmail.From = "(e-mail address removed)";

objEmail.Cc = "(e-mail address removed)";

objEmail.Subject = "Test Email";

objEmail.Body = "test" ;

objEmail.Priority = MailPriority.High;


//SmtpMail.SmtpServer =Request.ServerVariables["SERVER_NAME"].ToString() ;

try

{


SmtpMail.SmtpServer = "localhost"; //127.0.0.1 works too

SmtpMail.Send(objEmail);

Response.Write("Your Email has been sent sucessfully -Thank You");

}

catch (Exception exc)

{

Response.Write("Send failure: " + exc.ToString());

}

and in iis I set relay for 127.0.0.1 and Allow all computers which
successfully authenticate to relay

and the IPaddress is all assigne if I change it to my ip addrees IOll have
this error

The transport failed to connect to the server.
ohter wise it doisent show any error and dosent sent any thing whats wrong?

Regards
 
Back
Top