Support Forums
[Help VB.NET] @live Mail Problems. - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [Help VB.NET] @live Mail Problems. (/showthread.php?tid=3536)

Pages: 1 2


[Help VB.NET] @live Mail Problems. - HmanDude - 12-11-2009

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.


RE: [Help VB.NET] @live Mail Problems. - dunlop03 - 12-11-2009

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



RE: [Help VB.NET] @live Mail Problems. - HmanDude - 12-12-2009

Done all of that and changed port to 587
[Image: 2z3yn28.jpg]

Same error message as before :/


RE: [Help VB.NET] @live Mail Problems. - dunlop03 - 12-12-2009

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)



RE: [Help VB.NET] @live Mail Problems. - HmanDude - 12-12-2009

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.


RE: [Help VB.NET] @live Mail Problems. - dunlop03 - 12-12-2009

Can u upload ur project somewhere so i can see it ?

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


RE: [Help VB.NET] @live Mail Problems. - Digital-Punk - 12-13-2009

(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.


RE: [Help VB.NET] @live Mail Problems. - dunlop03 - 12-13-2009

what u mean ?


RE: [Help VB.NET] @live Mail Problems. - Digital-Punk - 12-13-2009

idk im retarded lol.


RE: [Help VB.NET] @live Mail Problems. - iRtehLeet - 12-14-2009

vbCrLf is the same as vBNewLine, also for hotmail or live

host: smtp.live.com
port: 587

i have done this and it works