sending email please somebody help Im confuseed

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
 
H

Henrik Bergman

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top