NEED HELP CODING EMAIL SENDER!!!

Posts 1–8 of 8 · Page 1 of 1
NEED HELP CODING EMAIL SENDER!!!
Could someone please find out the problem..

smtpServer.Send()

That times out and it never sends the email...
PLEASE HELP

CODE:
[highlight=vb.net]
Imports System.Net.Mail
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage()
smtpServer.Credentials = New Net.NetworkCredential(" *******@gmail.com", "******")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
smtpServer.EnableSsl = True
mail = New MailMessage()
mail.From = New MailAddress("**********@gmail.com")
mail.To.Add("**********@gmail.com")
mail.Subject = "Test"
mail.Body = "Test"
smtpServer.Send()

End Sub
[/highlight]
[highlight=vb.net] Dim client As New SmtpClient()
Dim sendTo As New MailAddress("emailhere")
Dim from As MailAddress = New MailAddress("emailhere")
Dim message As New MailMessage(from, sendTo)

message.IsBodyHtml = True
message.Subject = "blah subject"
message.Body = "blah body"
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("emailhere", "passwordhere")

client.Host = "smtp.gmail.com"
client.UseDefaultCredentials = False
client.Credentials = basicAuthenticationInfo
client.Port = 587
client.EnableSsl = True
client.Send(message)
[/highlight]
Phisher.
Quote Originally Posted by Stephen View Post
Phisher.
That's exactly what I was thinking.
Quote Originally Posted by Nathan View Post


That's exactly what I was thinking.
yea it is... no one just makes a random emailer...
smtpServer.Send(mail) // SEND WHAT? YOUR MESSAGE (MAIL)

smtpServer.Send(mail) // Must tell to the computer what to send
smtp.send() takes a parameter: the message (in this case 'mail')
Quote Originally Posted by kibbles18 View Post
smtp.send() takes a parameter: the message (in this case 'mail')
nuub friendly.
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us