Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help VB.NET] @live Mail Problems.
#1
I am coding a Live email sender.

Code:
MyMailMessage.From = New MailAddress(TextBox3.Text)

            MyMailMessage.To.Add(TextBox3.Text)

            MyMailMessage.Subject = (TextBox4.Text)

            MyMailMessage.Body = (TextBox5.Text & vbCrLf)

            Dim SMTPServer As New SmtpClient("smtp.live.com")

            SMTPServer.Port = 25

            SMTPServer.Credentials = New System.Net.NetworkCredential(TextBox1.Text, TextBox2.Text)

            SMTPServer.EnableSsl = True

            SMTPServer.Send(MyMailMessage)

Is the code i'm using right? When I debug and try and send, It highlights SMTPServer.Send(MyMailMessage) :S

Thanks for any help.
Reply
#2
Change your port number to : 587
Also do u have this on the very top of all your code :

Code:
Imports System.Web
Imports System.IO
Imports System.Net.Mail
Reply
#3
Done all of that and changed port to 587
[Image: 2z3yn28.jpg]

Same error message as before :/
Reply
#4
Use this :

Code:
Dim mail As New MailMessage()
        Dim SmtpServer As New SmtpClient

        SmtpServer.Credentials = New Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
        SmtpServer.Port = 587
        SmtpServer.Host = "Smtp.live.com"
        SmtpServer.EnableSsl = True
        mail.To.Add(TextBox3.Text)
        mail.From = New MailAddress(TextBox3.Text)
        mail.Subject = TextBox4.Text
        mail.Body = TextBox5.Text
        SmtpServer.Send(mail)

You were getting the error from this line of code , (wht is >>>> vbCrLf ):

Code:
MyMailMessage.Body = (TextBox5.Text & vbCrLf)
Reply
#5
Mailbox unavailable. The server response was: 5.7.3 Requested action aborted; user not authenticated

and it's highlighted SmtpServer.Send(mail) as an error.
Reply
#6
Can u upload ur project somewhere so i can see it ?

Also what is >>>>>>>>> vbCrLf
Reply
#7
(12-12-2009, 05:38 AM)dunlop03 Wrote: Can u upload ur project somewhere so i can see it ?

Also what is >>>>>>>>> vbCrLf

you know what, i think that will add extra unneeded spaces.
~ Digital-Punk
Reply
#8
what u mean ?
Reply
#9
idk im retarded lol.
~ Digital-Punk
Reply
#10
vbCrLf is the same as vBNewLine, also for hotmail or live

host: smtp.live.com
port: 587

i have done this and it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)