Sending form submission via e-mail Asp.net 2.0 using vb.net

1 view
Skip to first unread message

Rnt6872

unread,
Oct 18, 2007, 10:19:14 AM10/18/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hello,
Can someone help me on this problem that I'm having send an email.
I using the two classes MailMessage() ,a dn SMTPClient(). I'm using
"localhost" and port 25 as my SMTP client and port assigment. I don't
recieve any errors. Is there a way I can check if the emails are in a
"que" or something?

Here is the format I'm using:
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "y...@youremail.com"

'(1) Create the MailMessage instance
Dim mm As New MailMessage(UsersEmail.Text, ToAddress)

'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False

'(3) Create the SmtpClient object
Dim smtp As New SmtpClient

'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub

Thank you in advance.

Andrew Badera

unread,
Oct 18, 2007, 11:44:49 AM10/18/07
to DotNetDe...@googlegroups.com
1. Are you in fact running an SMTP service on 25?
2. You're better off using the Asynchronous send, and registering a callback event.
3. If you've really got a brass pair, it's pretty simple to write your own SMTP client, and directly receive the protocol responses from the SMTP server itself, including error or success messages. Little bit of socket communication, little bit of threading (mostly thread.sleep IIRC) and you're done.
4. Yes most SMTP servers have logs as well. Where they are depends on your SMTP server. If you're using the MS SMTP server boxed with most Windows versions, you can usually find it in the Windows log directory where you'd look for your web server logs, ftp logs, etc. etc.



On 10/18/07, Rnt6872 <r_fo...@msn.com> wrote:

Hello,
Can someone help me on   this problem that I'm having send an email.
I using the two classes MailMessage() ,a dn SMTPClient(). I'm using
"localhost" and port 25 as my SMTP client and port assigment. I don't
recieve any errors. Is there a way I can check if the emails are in a
"que" or something?

Here is the format I'm using:
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs ) Handles SendEmail.Click
Reply all
Reply to author
Forward
0 new messages