469,887 Members | 1,222 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

sending mail causes exception

33
I am trying to send emailes ,but it leades to exeption

the exeption message is "Failure sending mail."



Try

Dim message As New MailMessage()

message.From =New MailAddress("sujithukvl@gmail.com")

message.To.Add(New MailAddress("sujithukvl@gmail.com"))

message.Subject ="Registration"

message.BodyEncoding = System.Text.Encoding.ASCII

message.Body ="message"

message.IsBodyHtml =True

Dim client As New SmtpClient()

client.Send(message)

Label1.Text ="Email has been sent."

Catch ex As Exception

Label1.Text ="Could not send email: " + ex.Message

End Try



and in web config i have



<mailSettings>

<smtp deliveryMethod="Network">

<network defaultCredentials="true" host="localhost" port="25" />

</smtp>

</mailSettings>

Both email address are original
I am using .NET2.0

my inner exception is that "unable to connect to remote server"



Kindly help me

sujith
Apr 26 '07 #1
1 1280
Frinavale
9,735 Expert Mod 8TB
I am trying to send emailes ,but it leades to exeption

the exeption message is "Failure sending mail."



Try

Dim message As New MailMessage()

message.From =New MailAddress("sujithukvl@gmail.com")

message.To.Add(New MailAddress("sujithukvl@gmail.com"))

message.Subject ="Registration"

message.BodyEncoding = System.Text.Encoding.ASCII

message.Body ="message"

message.IsBodyHtml =True

Dim client As New SmtpClient()

client.Send(message)

Label1.Text ="Email has been sent."

Catch ex As Exception

Label1.Text ="Could not send email: " + ex.Message

End Try



and in web config i have



<mailSettings>

<smtp deliveryMethod="Network">

<network defaultCredentials="true" host="localhost" port="25" />

</smtp>

</mailSettings>

Both email address are original
I am using .NET2.0

my inner exception is that "unable to connect to remote server"



Kindly help me

sujith
Does your email service provider require user credentials to be provided in order to send emails?

-Frinny
Apr 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Ray Booysen | last post: by
2 posts views Thread by Danny | last post: by
4 posts views Thread by =?Utf-8?B?R3V5IENvaGVu?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.