473,473 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vb 2005 email

Trying to send email via vb 2005 win form. I'm able to send email out via Outlook express from this account and I verified everything 100 times, I don't think it's my host email server.
I can't figure out what I'm doing wrong.
Any help?

I've got this code

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim EMsg As New System.Net.Mail.MailMessage
EMsg.From = New MailAddress("To**@ValidAddress.com")
EMsg.To.Add("To**@ValidAddress.com")
EMsg.Subject = "this is a test email"
EMsg.Body = "this is the body of the email"
'EMsg.IsBodyHtml = True
'send the message
Dim smtp As New SmtpClient("http://mail.ValidAddress.com")
smtp.Credentials = New Net.NetworkCredential("To**@ValidAddress.com", "ValidPassword", "mail.ValidAddress.com")
Try
smtp.Send(EMsg)
Catch ex As Exception
' MsgBox(ex.ToString)
txtMessage.Text = ex.ToString
End Try
End Sub

I get this Error

System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead (Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(S mtpReplyReader caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(Sm tpReplyReader caller)
at System.Net.Mail.SmtpReplyReader.ReadLine()
at System.Net.Mail.SmtpConnection.GetConnection(Strin g host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at EMail.Form1.btnSend_Click(Object sender, EventArgs e) in C:\Documents and Settings\Tony\My Documents\Visual Studio 2005\Projects\EMail\EMail\Form1.vb:line 20

Thanks
Feb 11 '06 #1
2 8994
Tony,

You smtp server is wrong it should be something like this.

Dim smtp As New SmtpClient("mail.ValidAddress.com")
smtp.Credentials = New Net.NetworkCredential("To**@ValidAddress.com",
"ValidPassword", "mail.ValidAddress.com")

Ken
----------------------

"Tony Mastracchio" <To******@MSN.Com> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
Trying to send email via vb 2005 win form. I'm able to send email out via
Outlook express from this account and I verified everything 100 times, I
don't think it's my host email server.
I can't figure out what I'm doing wrong.
Any help?

I've got this code

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSend.Click
Dim EMsg As New System.Net.Mail.MailMessage
EMsg.From = New MailAddress("To**@ValidAddress.com")
EMsg.To.Add("To**@ValidAddress.com")
EMsg.Subject = "this is a test email"
EMsg.Body = "this is the body of the email"
'EMsg.IsBodyHtml = True
'send the message
Dim smtp As New SmtpClient("http://mail.ValidAddress.com")
smtp.Credentials = New Net.NetworkCredential("To**@ValidAddress.com",
"ValidPassword", "mail.ValidAddress.com")
Try
smtp.Send(EMsg)
Catch ex As Exception
' MsgBox(ex.ToString)
txtMessage.Text = ex.ToString
End Try
End Sub

I get this Error

System.Net.Mail.SmtpException: Failure sending mail. --->
System.IO.IOException: Unable to read data from the transport connection:
net_io_connectionclosed.
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead (Byte[] buffer,
Int32 offset, Int32 read, Boolean readLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(S mtpReplyReader
caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(Sm tpReplyReader
caller)
at System.Net.Mail.SmtpReplyReader.ReadLine()
at System.Net.Mail.SmtpConnection.GetConnection(Strin g host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at EMail.Form1.btnSend_Click(Object sender, EventArgs e) in C:\Documents
and Settings\Tony\My Documents\Visual Studio
2005\Projects\EMail\EMail\Form1.vb:line 20

Thanks
Feb 12 '06 #2
Hi Tony,

See if the problem is addressed here:

http://systemwebmail.com/

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Tony Mastracchio" <To******@MSN.Com> escribió en el mensaje news:uP**************@TK2MSFTNGP09.phx.gbl...
Trying to send email via vb 2005 win form. I'm able to send email out via Outlook express from this account and I verified everything 100 times, I don't think it's my host email server.
I can't figure out what I'm doing wrong.
Any help?

I've got this code

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim EMsg As New System.Net.Mail.MailMessage
EMsg.From = New MailAddress("To**@ValidAddress.com")
EMsg.To.Add("To**@ValidAddress.com")
EMsg.Subject = "this is a test email"
EMsg.Body = "this is the body of the email"
'EMsg.IsBodyHtml = True
'send the message
Dim smtp As New SmtpClient("http://mail.ValidAddress.com")
smtp.Credentials = New Net.NetworkCredential("To**@ValidAddress.com", "ValidPassword", "mail.ValidAddress.com")
Try
smtp.Send(EMsg)
Catch ex As Exception
' MsgBox(ex.ToString)
txtMessage.Text = ex.ToString
End Try
End Sub

I get this Error

System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead (Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(S mtpReplyReader caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(Sm tpReplyReader caller)
at System.Net.Mail.SmtpReplyReader.ReadLine()
at System.Net.Mail.SmtpConnection.GetConnection(Strin g host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at EMail.Form1.btnSend_Click(Object sender, EventArgs e) in C:\Documents and Settings\Tony\My Documents\Visual Studio 2005\Projects\EMail\EMail\Form1.vb:line 20

Thanks
Feb 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.