Jump to content
Krisler12™

[VB.NET] Cum pot trimite mail de pe hotmail ?

Recommended Posts

Posted

Salut !

Stie careva cum se poate trimite un email folosind ca sender un cont de hotmail ?

Am gasit pe net doar asta:

Dim MyMailMessage As New MailMessage 
MyMailMessage.From = New MailAddress(TextBox1.Text)
MyMailMessage.To.Add(TextBox1.Text)

Dim SMTP As New SmtpClient("smtp.live.com")
SMTP.Port = 25
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("textbox1.text", "textbox2.text")
SMTP.Send(MyMailMessage) // I have no idea how to get a response here... from the live server if it gives me a correct or incorrect response...

Using VB.NET to log into Windows Live Mail? - efreedom

Numai ca nu stiu ce are ca nu merge... :(

Incercati si voi sa vedeti daca va merge sau nu ca poate mie nu imi merge ca am windows x64 biti si poate de asta.

Oricum vad ca iti poti face doua tipuri de adrese user@hotmail.com dar si user@live.com.

E una si aceeasi macare de peste sau sunt diferite si folosesc smtp-uri diferite ? (intreb ptr. ca am incercat in loc de smtp.live.com, smtp.hotmail.com si imi arata ceva in legatura cu serverul, asta una la mana, a doua la mana e ca as vrea sa fac un fel de mail sender si vreau sa stiu daca sa il fac ptr. doua chestii diferite sau doar ptr. una singura ptr ca ambele sunt la fel).

Multumesc !

Posted (edited)

@1:

Adaugi:

1 button

4 textbox-uri

1 Richtextbox

textbox1.text = userul contului hotmail.com

textbox2.text = parola contului hotmail.com

textbox3.text = Subiectul

textbox4.text = Mailul celui care primeste mailul

richtextbox1.text = mesajul pe care vrei sa il trimiti

In button1 adaugi asta:

 System.EventArgs) Handles Button1.Click
Dim mail As New MailMessage()
Dim SmtpServer As New SmtpClient
SmtpServer.Credentials = New Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SmtpServer.Port = 25
SmtpServer.Host = smtp.hotmail.com
SmtpServer.EnableSsl = True
mail.To.Add(TextBox4.Text)
mail.From = New MailAddress(TextBox1.Text)
mail.Subject = TextBox3.Text
mail.Body = RichTextBox1.Text
Try
SmtpServer.Send(mail)
Catch ex As Exception
End Try
End Sub

Mai sus de "Public class form1" adaugi asta:

Imports System.Net.Mail

@2

La hotmail este asa:

smtp.live.com

port: 25

Edited by nSnoopy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...