Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP Authentication

Status
Not open for further replies.

Kingkumar

Programmer
Jan 21, 2003
167
US
Hi,
I am using smtp server in my vb.net winforms and using following two lines for the authentication purpose

email.Fields(" = Username
email.Fields(" = Password

i have a function which is called every time we want to send the email ( which is generally 120-200 emails each time the application is run )

Now the question i have is that if i want to authenticate teh smtp server only once and keep on sending emails until all the mails are sent IS IT POSSIBLE TO DO THAT? . (right now for each email it does authenticate)

THANKS
 
Hi Kingreen
Have you resolved this problem.
I have a similar problem in that my one smtp does not require authentication and I can send emails via VBNET with that, but I wish to use another smtp which requires authentication and I cannot get it to send emails with the same program code. I do not know how to set authentication.


PK Odendaal
 
MyMessage.From = txtFromEmail.Text
MyMessage.Subject = txtSubject.Text
MyMessage.Body = txtMessage.Text
MyMessage.BodyFormat = MailFormat.Html

Response = MsgBox("Are you sure you wish to send email to all the addresses in " & vbCrLf & dbCn.DataSource & vbCrLf & " from " & txtFromEmail.Text & vbCrLf & " with attachment " & vbCrLf & txtAttachment.Text, MsgBoxStyle.YesNo)
If Response = vbNo Then Exit Sub

Hi johnee2

Here is my code (partly):

MyMessage.Attachments.Add(myAttachment)
SmtpMail.SmtpServer = "mail.odendaal.com"

Do While drClients.Read
drClients.Read()
Clientname = drClients.Item("Clientname").ToString
HisEmail = drClients.Item("email").ToString
MyMessage.To = HisEmail
SmtpMail.Send(MyMessage)
lblNote.Text = "Sending email to " & Clientname
Loop
dbCn.Close()
lblNote.Text = "All email was sent successfully"

Thanks


PK Odendaal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top