Results 1 to 7 of 7

Thread: [Resolved][2005] The specified e-mail address is currently not supported.

  1. #1

    Thread Starter
    Member computerguy46's Avatar
    Join Date
    Jan 2006
    Posts
    32

    Resolved [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member computerguy46's Avatar
    Join Date
    Jan 2006
    Posts
    32

    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.

  4. #4
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    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
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] The specified e-mail address is currently not supported.

    Quote 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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Member computerguy46's Avatar
    Join Date
    Jan 2006
    Posts
    32

    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

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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:
    1. 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:
    1. myTextBox.Text = myListViewItem.Text
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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