Solved

send mail in vb 2008 with autentication

Posted on 2009-04-02
4
895 Views
Last Modified: 2013-11-30
I'm using this code:
'''
'''
See code


'''
'''

Im' reciving:
+System.Net.Mail.SmtpException      5.7.3 Requested action aborted; user not authenticated"}      System.Net.Mail.SmtpException

Try
            Dim Message As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
            Dim Smtp As New System.Net.Mail.SmtpClient()
            Dim SmtpUser As New System.Net.NetworkCredential()
            '-- Build Message
            Message.From = New System.Net.Mail.MailAddress("xxx@hotmail.com", "My name")
            Message.To.Add(New System.Net.Mail.MailAddress("email@server.com", "Other Name"))
            Message.IsBodyHtml = False
            Message.Subject = "Come on My Show Soon"
            Message.Body = "Please be a guest on my show. - Larry"
            '-- Define Authenticated User
            SmtpUser.UserName = "xxl@hotmail.com" 
            SmtpUser.Password = "Password"
            SmtpUser.Domain = "smtp.live.com"
            '-- Send Message
            Smtp.UseDefaultCredentials = False
            Smtp.Credentials = SmtpUser
            Smtp.Host = "smtp.live.com"
            Smtp.EnableSsl = True
            Smtp.Port = 25
            Smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
            Smtp.Send(Message)
            MessageBox.Show("OK")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

Open in new window

0
Comment
Question by:cpx_Support
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
Dgleich earned 500 total points
ID: 24052402
Hmm Try this code:

Just change it to use diffrent smtp server...
        Dim message As System.Net.Mail.MailMessage
        Dim smtp As New System.Net.Mail.SmtpClient("smtp.gmail.com", 587)
 
        smtp.Credentials = New System.Net.NetworkCredential("Your gmail username", "password")
        message = New System.Net.Mail.MailMessage("From:", "To:", "Subject", "mail here")
        smtp.EnableSsl = True
        smtp.Send(message)

Open in new window

0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 24052882
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24053001
Last I heard, Hotmail (and I assume Live as well) didn't have a public interface to send email through code. Because it's web-based, you have to go through browser. I'd love to know otherwise.
0
 

Author Comment

by:cpx_Support
ID: 24057225
Hello emoreau i looked the link but I think i'm using the correct configuration but doen't work.

Kaufmed, I read that Hotmail now let users send mail throug smtp but in any case I tried with gmail and I'm getting the same error.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question