473,670 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vb sending email

jamesd0142
469 Contributor
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 6646
debasisdas
8,127 Recognized Expert Expert
Question moved to .NET Forum.
Oct 31 '07 #2
Plater
7,872 Recognized Expert Expert
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 Contributor
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 Recognized Expert Expert
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 Contributor
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 Recognized Expert Expert
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 Contributor
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 Contributor
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 Recognized Expert Expert
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@domai n.com" and not just "username" ?
Nov 14 '07 #10

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

Similar topics

3
7042
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. Obviuosly, the file is fine on the server, so the attachment code I am using must be corrupting it, but I dont know what it is: // send email with attachment function emailAttachment($to, $subject, $message, $name, $email,
0
522
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 import mimetypes import os,string
3
6820
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 (non-MyDomain.com address) I get the following error: The server rejected one or more recipient addresses. The server response was: 550 You must check your mail from this IP or SMTP Auth before sending to BSmith@Juno.com Here's the FULL...
3
3611
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 smtpMail.Send("from@here.com", to@there.com, "Message subject", "Message Body") I'm sending it to my own email address on a different server using a dummy
1
8175
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 the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
2
12168
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, error is thrown at the .send point. Error is: The following error occured Sending an email: System.ApplicationException: An error occurred sending an email To helen@HerMail.com From ade@MyMail.com Cc Subject A test with Finlistener #1. The body...
9
3454
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 oSMTP.Send(oMailMessage) (in this line I am getting the above err)
7
3332
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 guests added. form.php function createGuestNameAndEmailElements() {
10
5078
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> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
31
12677
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 is working for normal email servers, but NOT with gmail server, I am very puzzled still!!) Codes(item c below) It keeps complaining and logs and codes are below. a) apache access logs --------------------------------- 127.0.0.1 - - "GET...
1
8591
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8660
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7415
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.