|
-
Jan 12th, 2008, 12:48 AM
#1
Thread Starter
Member
[Resolved][2005] The specified e-mail address is currently not supported.
i am trying to send an email to 1 or more persons and when i get to mail.To.Add(TextBox6.Text) i get the following error. any help will be great
thanks in advance.
The specified e-mail address is currently not supported.
here is the code i am using
Imports System.Net.Mail
Imports System.Net
Dim j As Long
TextBox5.Text = ""
Dim mail As New Net.Mail.MailMessage()
For j = 1 To ListView1.CheckedItems.Count.ToString
TextBox6.Text = ListView1.CheckedItems(0).ToString
'etc to include all subitems so the entire row is moved
mail.From = New Net.Mail.MailAddress("[email protected]")
error here mail.To.Add(TextBox6.Text)
mail.Subject = TextBox1.Text
mail.Body = TextBox2.Text & vbCrLf & TextBox3.Text
TextBox5.Text = "Email Sent To " & TextBox6.Text
'If TextBox4.Text <> "" Then
mail.Attachments.Add(New System.Net.Mail.Attachment(TextBox4.Text))
'End If
Dim smtp As New Net.Mail.SmtpClient("192.168.101.10")
'smtp.Timeout = 30 * 1000 ' Milliseconds
smtp.Send(mail)
Next j
TextBox5.Text = "Finished"
Last edited by computerguy46; Jan 16th, 2008 at 10:46 AM.
Reason: resolved
-
Jan 12th, 2008, 02:15 AM
#2
Re: [2005] The specified e-mail address is currently not supported.
If the specified e-mail address is not supporte4d then we'd obviously have to know what the specified e-mail address is. EXACTLY what does TextBox6.Text contain?
-
Jan 14th, 2008, 10:13 AM
#3
Thread Starter
Member
Re: [2005] The specified e-mail address is currently not supported.
listviw1 has a list of email address that are checked textbox6 = the first checked item in listview1. which is a vailed email address
TextBox6.Text = "ListViewItem: {[email protected]}"
Last edited by computerguy46; Jan 14th, 2008 at 10:35 AM.
-
Jan 14th, 2008, 10:28 AM
#4
Fanatic Member
Re: [2005] The specified e-mail address is currently not supported.
straight from the msdn documentation
MailMessage..::.To Property
The To property is used to designate the addresses on the To line of an e-mail message. To add a recipient to an e-mail message, create a MailAddress for the recipient's address, and then add that object to the collection returned by this property
Review your mailmessage.to statement
-
Jan 14th, 2008, 05:41 PM
#5
Re: [2005] The specified e-mail address is currently not supported.
 Originally Posted by computerguy46
listviw1 has a list of email address that are checked textbox6 = the first checked item in listview1. which is a vailed email address
TextBox6.Text = "ListViewItem: { [email protected]}"
Ask yourself this: if you typed "ListViewItem: {[email protected]}" into the address field of a new message in your own e-mail client, would you expect it to get through? Does that look like a valid e-mail address to you?
-
Jan 16th, 2008, 10:45 AM
#6
Thread Starter
Member
Re: [2005] The specified e-mail address is currently not supported.
i fixed the problem "ListViewItem: {[email protected]}" i had to make a code change to take out the ListViewItem: {} part of the string thanks for your help
-
Jan 16th, 2008, 05:18 PM
#7
Re: [Resolved][2005] The specified e-mail address is currently not supported.
I think you'll find that you've gone the long way around. How did that value get into the TextBox in the first place? I'll wager that at some point you've assign a ListViewItem to the Text property of the TextBox, e.g.
vb.net Code:
myTextBox.Text = myListViewItem
That will implicitly call the ListViewItem's ToString method, which produces the result you're seeing. What you should have been doing was getting the Text property of the ListViewItem, NOT the ListViewItem itself, e.g.
vb.net Code:
myTextBox.Text = myListViewItem.Text
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
|