help -- sending email on the server

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

Guest

I used the following code sending email on the server. I got no error messages but I never received any email..

System.Web.Mail.SmtpMail.Send("(e-mail address removed)","(e-mail address removed)", "test", "test")

Could someone help me out. Thank you..
 
Try setting the SmtpServer property to your SMTP server

Tu-Thac

----- vagzone wrote: ----

I used the following code sending email on the server. I got no error messages but I never received any email.

System.Web.Mail.SmtpMail.Send("(e-mail address removed)","(e-mail address removed)", "test", "test"

Could someone help me out. Thank you..
 
Could you tell me how to set the SmtpServer property on SMTP server if
you feel free.. Thank you so much..
 
You might also look into OpenSmtp on source forge. It is a C# SMTP client
that you can use to send mail without having to worry that the hosting
service has the mail settings configured. It send the mail directly and
handles authentication.

--
Rocky Moore
www.HintsAndTips.com - Share your tips with the world!
~~~~~~~~~ Developer Tips Welcome! ~~~~~~~~~


vagzone said:
I used the following code sending email on the server. I got no error
messages but I never received any email..
 
If I was a bit short there,

Cut & Pasted
' Set the SmtpServer name. This can be any of the following depending on
' your local security settings:

' a) Local IP Address (assuming your local machine's SMTP server has
the
' right to send messages through a local firewall (if present).

' b) 127.0.0.1 the loopback of the local machine.

' c) "smarthost" or the name or the IP address of the exchange
server you
' utilize for messaging. This is usually what is needed if you are
behind
' a corporate firewall.

' See the Readme file for more information.
'SmtpMail.SmtpServer = "smarthost"
SmtpMail.SmtpServer = "127.0.0.1"

' Use structured error handling to attempt to send the email message
and
' provide feedback to the user about the success or failure of their
' attempt.
Try
SmtpMail.Send(mailMsg)
lstAttachments.Items.Clear()
lstAttachments.Items.Add("(No Attachments)")

MessageBox.Show("Your email has been successfully sent!", _
"Email Send Status", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
Catch exp As Exception
MessageBox.Show("The following problem occurred when attempting
to " & _
"send your email: " & exp.Message, _
Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

Hope you get more clear view there
 
Back
Top