
Originally Posted by
Biesi
Can't you just save the email address in a string?
Code:
Imports System.Net
Imports System.Net.Mail
Code:
Dim smpts As New SmtpClient()
smtps.Host = "???" 'google for the SMTP server you need
smtps.Credentials = New NetworkCredential("username", "password")
Code:
Dim mailmsg As New MailMessage
mailmsg.From = New MailAddress("mail")
mailmsg.To.Add("mail")
mailmsg.Subject = "subject"
mailmsg.Body = "content"
smtps.Send(mailmsg)
Hello , i did not really understand the second code . . .
i am actually a beginner , still learning visual basic programming . . .
Questions :
1 . what is basicly an smtp stands for and what does it do ?
2 . i did not really catch you there on the host part . . . is this necessary , maybe answering the first question might also solve second question .
3 . the 3rd line of the Second code . . . it basicly will send the entered information by the user when he clicks on the send button right ?
4 . Im assuming the the smtp host = "???" . . . might be the port like for gmail ? is it possible to extend the number of ports here since it might be possible user enters maybe a yahoo email or any other , sorry im a beginner so i didn't really know about smtp lolz so im assuming , please correct me if im wrong . .
5 . i dont really get how to sort the code out ? (i should add the codes where?)
What I Think The Code Might Be For Me :
Code:
Dim smpts As New SmtpClient()
smtps.Host = "???" 'google for the SMTP server you need ( did not really understand this )
smtps.Credentials = New NetworkCredential(textbox1.text, textbox2.text)
Code:
Dim mailmsg As New MailMessage
mailmsg.From = New MailAddress("Test@example.com") 'im guessing that adding the email here is not really important right ?
mailmsg.To.Add(textbox_email.text)
mailmsg.Subject = "example"
mailmsg.Body = "example"
smtps.Send(mailmsg)
what i assume this code will do :
it will send the text in maybe for example textbox1 and the text from textbox2 for example to a specific email on another textbox . . . and then ofcourse with few small details . . .
and i basicly hate saving data content in/as strings , it just causes so many problems for me when i start coding for other stuff . . . its like having a junk all over your desktop with the same name and trying to look for what you want . . . thats why i used the filestream option instead . . .
Please correct me if im wrong , im a beginner as i mentioned

Thanks
