Support Forums

Full Version: [Help VB.NET] @live Mail Problems.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
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
Done all of that and changed port to 587
[Image: 2z3yn28.jpg]

Same error message as before :/
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)
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.
Can u upload ur project somewhere so i can see it ?

Also what is >>>>>>>>> vbCrLf
(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.
what u mean ?
idk im retarded lol.
vbCrLf is the same as vBNewLine, also for hotmail or live

host: smtp.live.com
port: 587

i have done this and it works
Pages: 1 2