473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Vb sending email

jamesd0142
469 256MB
Expand|Select|Wrap|Line Numbers
  1. 'server address
  2.         Dim client As New SmtpClient("imap.uk.aol.com", 143)
  3.         'username and password
  4.         client.Credentials = New Net.NetworkCredential("my username", "mypassword")
  5.         Dim mm As New MailMessage("my emailaddress@aol.com", "otheremailaddress@somewhere.co.uk")
  6.         'Set Subject
  7.         mm.Subject = "Test"
  8.         'set message
  9.         mm.Body = "Test123"
  10.         'html???
  11.         mm.IsBodyHtml = False
  12.         'send email
  13.         Try
  14.             client.Send(mm)
  15.             'give error if any
  16.         Catch ex As Exception
  17.             'display error message
  18.             MessageBox.Show(ex.ToString)
  19.         End Try
  20.  
please look at the error message attached and help i dont no what this even means.
thanks

Hi if you cant read the attached file...
Expand|Select|Wrap|Line Numbers
  1. System.Net.Mail.SmtpException: Failure sending mail. ---> System.FormatException: Smtp server returned an invalid response.
  2.    at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
  3.    at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
  4.    at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
  5.    at System.Net.Mail.SmtpReplyReader.ReadLine()
  6.    at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
  7.    at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
  8.    at System.Net.Mail.SmtpClient.GetConnection()
  9.    at System.Net.Mail.SmtpClient.Send(MailMessage message)
  10.    --- End of inner exception stack trace ---
  11.    at System.Net.Mail.SmtpClient.Send(MailMessage message)
  12.    at Email.Form1.email1() in C:\Documents and Settings\DatadissUser\My Documents\Visual Studio 2005\Projects\Email\Email\Form1.vb:line 28
Oct 31 '07 #1
11 6613
debasisdas
8,127 Expert 4TB
Question moved to .NET Forum.
Oct 31 '07 #2
Plater
7,872 Expert 4TB
it means instead of getting the 3digit success code from the SMTP server, it got back something else.
Could be the number assoicated with "not allowed" or "we're shutting down" or "didn't understand your command"
Are your username and password supplied correctly?

You may have to packet watch to see the network traffic and see the actual reply message from the smtp server.


EDIT: Your server might also be setup for SSL only, or to deny smtp usage unless you turn it on (gmail is like that)
Oct 31 '07 #3
jamesd0142
469 256MB
it means instead of getting the 3digit success code from the SMTP server, it got back something else.
Could be the number assoicated with "not allowed" or "we're shutting down" or "didn't understand your command"
Are your username and password supplied correctly?

You may have to packet watch to see the network traffic and see the actual reply message from the smtp server.


EDIT: Your server might also be setup for SSL only, or to deny smtp usage unless you turn it on (gmail is like that)
all sounds a little over my head...

what is this ssl, and how do i turn smtp usage on?
Oct 31 '07 #4
Plater
7,872 Expert 4TB
OK yeah
hehe, I just looked closer at your code.
You're trying to use their IMAP server and IMAP port as your STMP server.
They're not the same.

Use the SMTP server instead and try that.
smtp.uk.aol.com
and the correct port of 25


http://members.aol.com/adamkb/aol/mailfaq/imap/
Oct 31 '07 #5
jamesd0142
469 256MB
thanks for the reply...

i get this message now...

Expand|Select|Wrap|Line Numbers
  1. System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'smtp.uk.aol.com'
  2.    at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
  3.    at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
  4.    at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
  5.    at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
  6.    at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
  7.    at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
  8.    at System.Net.Mail.SmtpClient.GetConnection()
  9.    at System.Net.Mail.SmtpClient.Send(MailMessage message)
  10.    --- End of inner exception stack trace ---
  11.    at System.Net.Mail.SmtpClient.Send(MailMessage message)
  12.    at Email.Form1.email1() in C:\Documents and Settings\DatadissUser\My Documents\Visual Studio 2005\Projects\Email\Email\Form1.vb:line 28
  13.  
I also tried port 587 and got the same message...
Nov 12 '07 #6
Plater
7,872 Expert 4TB
Are you connected to the internet?
I was able to use that email server just fine.

No troubles resolving or anything.
Non-authoritative answer:
Name: smtp.cs.com
Addresses: 205.188.249.185, 64.12.171.246, 64.12.180.144, 205.188.159.153
205.188.159.185
Aliases: smtp.uk.aol.com
Nov 12 '07 #7
jamesd0142
469 256MB
yes i have an internet connection, im actually using a server in work so its possible it may b blocked :S

suppose its best to test this at home
Nov 12 '07 #8
jamesd0142
469 256MB
Expand|Select|Wrap|Line Numbers
  1. System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was: CLIENT AUTHENTICATION REQUIRED. USE ESMTP EHLO AND AUTH.
  2.    at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
  3.    at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
  4.    at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
  5.    at System.Net.Mail.SmtpClient.Send(MailMessage message)
  6.    at Email.Form1.email1() in C:\Documents and Settings\DatadissUser\My Documents\Visual Studio 2005\Projects\Email\Email\Form1.vb:line 28
  7.  
My login and password are correct

my code is as follows, any ideas???
Expand|Select|Wrap|Line Numbers
  1. Private Sub email1()
  2.         'server address
  3.         Dim client As New SmtpClient("smtp.uk.aol.com", 25)
  4.         'username and password
  5.         client.Credentials = New Net.NetworkCredential("MyUsername", "MyPassword")
  6.         Dim mm As New MailMessage("MyEmail", "SendtoEmail")
  7.         'Set Subject
  8.         mm.Subject = "Test"
  9.         'set message
  10.         mm.Body = "Test123"
  11.         'html???
  12.         mm.IsBodyHtml = False
  13.         'send email
  14.         Try
  15.             client.Send(mm)
  16.             'give error if any
  17.         Catch ex As Exception
  18.             'display error message
  19.             TextBox1.Text = ex.ToString
  20.             'MessageBox.Show(ex.ToString)
  21.         End Try
  22.     End Sub
  23.  
Thanks
Nov 14 '07 #9
Plater
7,872 Expert 4TB
I'm not sure what kind of wierd business your code is doing?

220 cia-ma06.mx.aol.com ESMTP mail_cia-ma06.3; Wed, 14 Nov 2007 08:41:35 -0400
EHLO plater.mydomain.com
250-cia-ma06.mx.aol.com (ip-removed)
250-AUTH=LOGIN PLAIN XAOL-UAS-MB
250-AUTH LOGIN PLAIN XAOL-UAS-MB
250-STARTTLS
250-CHUNKING
250-BINARYMIME
250-X-AOL-FWD-BY-REF
250-X-AOL-OUTBOX-COPY
250 HELP
AUTH PLAIN
334 Username:
plater
334 Password:
plater
535 AUTHENTICATION FAILED
HELP
214-This is America Online mail version v120.9
214-Commands:
214- HELO EHLO MAIL RCPT DATA BDAT
214- RSET NOOP QUIT HELP
214-For more information contact postmaster@aol.com
214 End of HELP info
RSET
250 OK

I don't have a username/password for them but their server seemed to respond as normal. are you making sure your your username is "username@domain.com" and not just "username" ?
Nov 14 '07 #10
jamesd0142
469 256MB
Ye ive tried both, username and username+domain

wiered stuff goin on i think :P

did u get the above message using my code?
Nov 14 '07 #11
Plater
7,872 Expert 4TB
It doesn't seem to like AUTH LOGIN, either it doesn't really like base64, or you need to use an SSL connection
Expand|Select|Wrap|Line Numbers
  1. 220 ciaaol-m05.mx.aol.com ESMTP mail_cia_aol-m05.8; Wed, 14 Nov 2007 11:11:28 -0500
  2. EHLO <computername removed>
  3. 250-ciaaol-m05.mx.aol.com <IP removed>
  4. 250-AUTH=LOGIN PLAIN XAOL-UAS-MB 
  5. 250-AUTH LOGIN PLAIN XAOL-UAS-MB 
  6. 250-STARTTLS
  7. 250-CHUNKING
  8. 250-BINARYMIME
  9. 250-X-AOL-FWD-BY-REF
  10. 250-X-AOL-OUTBOX-COPY
  11. 250 HELP
  12. AUTH login TXlVc2VybmFtZQ==
  13. 501 INVALID SASL FORMAT OR LENGTH
  14. MAIL FROM:<MyEmail@mydomain.com>
  15. 556 CLIENT AUTHENTICATION REQUIRED. USE ESMTP EHLO AND AUTH.
  16.  
Nov 14 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
31
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.