|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
[Question] Vb.net- SMTP email
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
PC Gamer
|
Quick question:
In vb.net, lets say you have 4 txtboxes... txtbox 1 and txtbox 2 being a message BOX NUMBER NAME TEXT 3 txtfrom Anything 4 txtto My email 5 txtsubject Anything 6 txtmsg textbox1.text and textobx2.text So how can I send an email to myself (username@gmail.com) and changing the parameters of the FROM, TO , SUBJECT and MESSAGE to the txtboxes? I tried some tutorials, didn't work. And every time I type "imports system.web.mail" on top of the pub class it shows an error.... [offtopic] And yes, I am new to overclock.net.... Impressive traffic on this site ![]() [/offtopic] :P
__________________
![]() ![]() ![]() ![]() ![]() Code:
If bored = true then
webbrowser1.browse ("www.overclock.net")
End If
|
|
|
|
|
|
#2 (permalink) | ||||
|
Programmer
|
I assume you'd need to configure a SMTP server in order to send the emails. I'll look over some of my stuff and hopefully get back to you sometime this week. (If someone doesn't answer before hand) Been busy of late.
__________________EDIT: Okay a google search brought back this. Give it a shot maybe? PHP Code:
Last edited by fentos : 08-26-08 at 02:56 AM. |
||||
|
|
|
|
|
#3 (permalink) |
|
PC Gamer
|
Thanks Fentos, will put that in and see if it works.
EDIT: This is for console, isn't it? And no worries, I found it bro. ^^ Code:
Dim Form17 As String
Form17 = "password"
txtMessage.Text = TextBox1.Text & ":" & TextBox2.Text
Dim message As System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient("smtp.gmail.com", 587)
Message = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text)
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("username@gmail.com", Form17)
smtp.Send(Message)
Me.Close()
Form15.Show()
There was ' in front of each line... Lol. Damn comments.
__________________
![]() ![]() ![]() ![]() ![]() Code:
If bored = true then
webbrowser1.browse ("www.overclock.net")
End If
Last edited by -Darkness- : 08-26-08 at 10:30 AM. |
|
|
|
![]() |
| Tags |
| vb.net |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|