DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008

    Help with connecting to an AT&T email account to send email using .NET

    Any help that anyone can provide to my coding would be greatly appreciated here. I'm very frustrated that I can't figure this out. What am I missing or doing wrong?

    Using VB 2010 Express, I have code for an AT&T email account that has worked great in the past, but since they have changed their login criteria, I have not been able to connect.

    The old data was as follows:
    Host: smtp.att.yahoo.com
    Port: 25

    The new settings are now:
    Host: outbound.att.net
    Port: 465
    SMTP required authentication.
    Server requires an encrypted connection (SSL)

    Here is my code with the old data commented out and the updates applied. At the end is the error message I receive.

    Imports System.Net.Mail

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

    Dim SmtpServer As New SmtpClient()
    Dim mail As New MailMessage()
    SmtpServer.Credentials = New _
    Net.NetworkCredential("MyEmail@bellsouth.net", "password")

    'SmtpServer.Port = 25 '<=== Old Port
    SmtpServer.Port = 465 '<=== New Port

    'SmtpServer.Host = "smtp.att.yahoo.com"'<=== Old Host
    SmtpServer.Host = "outbound.att.net" '<=== New Host

    SmtpServer.EnableSsl = True '<=== I added this code for new connection

    mail = New MailMessage()
    mail.From = New MailAddress("MyEmail@bellsouth.net")
    mail.Subject = "My Test Mail"
    mail.Body = "This is for testing SMTP mail using .NET"

    MsgBox("mail sent")

    Catch ex As Exception
    End Try

    End Sub

    When ran I get this error:

    System.Net.Mail.SmtpException: Failure sending mail. - System.IO.IOExecption: Unable to read data from the transport connection: net_io_connectionclosed.
    at SystemNet.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 read, Boolean readline)
    at SystemNet.Mail.SmtpReplyReaderFactory.ReadLines(SmptReplyReader caller, Boolean online)
    at SystemNet.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
    at SystemNet.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
    at SystemNet.Mail.SmtpClient.GetConnection()
    at SystemNet.Mail.SmtpClient.Send(MailMessage message)
    ---End of inner exception stack trace ---
    at System.Net.MailSmtpClient.Send(MailMessage message)
    at WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\MyName\Local Settings\Application\Data\Temporary Projects\WindowsApplication1\Form1.vb:line 33

  2. #2
    Join Date
    Feb 2008
    After an all day of frustrations I figured it out all by accident. I found a video on YouTube and the guy in the video was using port 587 even though he wasn’t trying to connect to AT&T. Well what the heck do I have to loose, so I tried port 587. IT WORKED! Why port 587 works and not port 465 that I use to send emails through Outlook is beyond me. But if it works, I’ll go with it, and I’m happy.

Similar Threads

  1. send email and receive email ASP module
    By helme_syahiemie in forum VB Classic
    Replies: 1
    Last Post: 10-06-2006, 06:17 PM
  2. send email to yahoo account
    By jimmy6 in forum Java
    Replies: 1
    Last Post: 12-29-2005, 12:29 PM
  3. Replies: 1
    Last Post: 04-26-2001, 02:16 AM
  4. open default email program and send email
    By anonymous in forum VB Classic
    Replies: 1
    Last Post: 02-16-2001, 09:38 AM
  5. Send email with another user's email ID.
    By nlw in forum Enterprise
    Replies: 1
    Last Post: 06-22-2000, 03:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.