|
-
Dec 31st, 2011, 05:34 PM
#1
Thread Starter
Addicted Member
[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
-
Jan 1st, 2012, 10:34 AM
#2
Re: VB Yahoo email sender
We cannot assist you without the error message you received from ex.message
-
Jan 1st, 2012, 12:14 PM
#3
PowerPoster
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.
-
Jan 1st, 2012, 06:02 PM
#4
Thread Starter
Addicted Member
Re: VB Yahoo email sender
oh, sorry about that....
After about 5 minutes the Try..Catch - ex.Message says --> The operation has timed out.
-
Jan 1st, 2012, 06:29 PM
#5
PowerPoster
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?
-
Jan 1st, 2012, 07:05 PM
#6
Thread Starter
Addicted Member
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?
-
Jan 1st, 2012, 07:16 PM
#7
PowerPoster
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?
-
Jan 1st, 2012, 07:28 PM
#8
Thread Starter
Addicted Member
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
-
Jan 1st, 2012, 07:31 PM
#9
PowerPoster
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)
-
Jan 1st, 2012, 07:48 PM
#10
Thread Starter
Addicted Member
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.
-
Jan 1st, 2012, 07:51 PM
#11
PowerPoster
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
-
Jan 1st, 2012, 08:02 PM
#12
Thread Starter
Addicted Member
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.....
-
Jan 1st, 2012, 08:11 PM
#13
-
Jan 1st, 2012, 08:19 PM
#14
PowerPoster
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.
-
Jan 1st, 2012, 08:53 PM
#15
Thread Starter
Addicted Member
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?
-
Jan 1st, 2012, 08:55 PM
#16
PowerPoster
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|