Results 1 to 16 of 16

Thread: [RESOLVED] VB Yahoo email sender

  1. #1

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Resolved [RESOLVED] VB Yahoo email sender

    hello i am trying to send an email with yahoo. but i'm getting an error i dont understand, can someone plz help.. my code is bellow...

    Code:
    Imports System.Net.Mail
    
    Public Class Form1
    
        Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Try
                Dim mail As New MailMessage
                mail.Subject = subbox.Text
                mail.To.Add(toBox.Text)
                mail.From = New MailAddress(frombox)
                mail.Body = bodybox.Text 'is a richtextbox
    
                Dim SMTP As New SmtpClient("plus.smtp.yahoo.com)' i also tried "smtp.yahoo.com"
                SMTP.EnableSsl = True
                SMTP.Credentials = New System.Net.NetworkCredential(userbox.Text, passbox.Text)
                SMTP.Port = "465" ' i also tried "587"
                SMTP.Send(mail)
                MessageBox.Show("Message Sent")
    
            Catch ex As Exception
                MessageBox.Show("Error ", ex.Message)
            End Try
        End Sub

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: VB Yahoo email sender

    We cannot assist you without the error message you received from ex.message

  3. #3
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    indeed, without the error message there is nothing we can help with.
    things to check:

    make sure your credentials are correct
    make sure that the port is correct
    be sure to check if the server requires SSL and if so, alter the ports accordingly
    be sure that the provider you are using allows you to send emails programmatically.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  4. #4

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    oh, sorry about that....

    After about 5 minutes the Try..Catch - ex.Message says --> The operation has timed out.

  5. #5
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    ok.
    there are many reasons for this:

    1) firewall is blocking the connection
    2) the provider does not allow sending emails (some explicitly deny, whilst others just let it time out)
    3) the details are incorrect for the connection or port number (again, some providers explicitly deny whilst others just let it time out)
    4) no internet connectivity found

    are you sure you have the CORRECT details?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  6. #6

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    i am very sure i got the information from this site --> http://www.emailaddressmanager.com/t...-settings.html

    well i know my firewall isn't blocking it but how do i find out if the provide is not allowing it?

  7. #7
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    by contacting the provider or reading their instructions/manuals.

    finding random things on the internet or old postings doesnt mean it will work

    did you try setting the address to use as this:

    smtp.mail.yahoo.com
    AND the EnableSSL to true along with the port being 995?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  8. #8

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    ok i used the smtp and the port u suggested and i got this error msg..

    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 98.136.185.95:995
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
    at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
    --- End of inner exception stack trace ---
    at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
    at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
    at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
    at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
    at System.Net.Mail.SmtpConnection.GetConnection(String 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_Info.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\User\Documents\Visual Studio 2010\Projects\Email Info\Email Info\Form1.vb:line 48

  9. #9
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    yeh. seems like yahoo dont allow sending emails programmatically or if they do, you need the CORRECT details.
    contact the provider or find a manual on their site (and only their site)

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  10. #10

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    could this be the problem?


    To verify an email address with the Yahoo! SMTP service, please follow these instructions from within Yahoo! Mail:
    Sign in to Yahoo! Mail
    Click the Options menu in the upper-left corner, and select Mail Options from the pull-down list.
    In the left pane, click Accounts, then in the right pane, click Add or edit an account. A separate Mail Accounts page appears.
    Click Add. The Add Account wizard appears.
    In the Account Name box, type a name for your own reference (for example, Work, School, Second Account), and click Continue.
    Complete the following information:
    Name: The name you want the person receiving email from this address to see.
    Email: The alternate email address from which you would like to send email. We’ll send a confirmation code to this email address.
    Click Continue. The Setup Mail Server page appears.
    Click Skip This Step and continue to the next step in these instructions.

    Note: You can add this information later by clicking Edit on the Mail Accounts page.

    The Verify Account page appears.
    Click Send Verification. A second Verify Account page appears, and email containing the confirmation code is sent to the account you named.
    In the account you named, look for an email similar to the following:

    Either click the link in the message or enter the confirmation code into the box in the second Verify Account page.
    Click Verify Account. You are returned to the Mail Accounts page, where you can see your new account has been added.
    Your alternate email address is now verified and can be used to send email through Yahoo! Mail or your email software.
    Note: You can verify up to 10 alternate email addresses for every primary and secondary Yahoo! Mail ID.

  11. #11
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    well if you dont have a yahoo account then how do you expect for it to work? you cant use any random email address and use a random mailserver....
    smells like spamming to me

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  12. #12

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    umm, i do have an account...... i searched for why yahoo blocking my mail and i got that.. just wondering if i need to do something extra for it to stop blocking my software.....

  13. #13
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    no, there shouldnt be.
    again, as said before - you need to contact yahoo to see if they allow programmatic sending of emails in addition to having the correct info.
    contact them

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  14. #14
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    i think you also may need to upgrade your account (paid) for this to work. again, some providers do this.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  15. #15

    Thread Starter
    Addicted Member lecfox's Avatar
    Join Date
    Dec 2011
    Location
    Jamaica
    Posts
    174

    Re: VB Yahoo email sender

    ok.. since i cant get the yahoo to work. i changed it to live... and it worked.. ....

    my next objective is to load the contacts from my live account into my vb project...
    any suggestions on how i can do that?
    or do i need to open a new thread?

  16. #16
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: VB Yahoo email sender

    open a new thread but suggestion: you need access to the API to do this. read the API documentation, if one exists.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width