By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

How to send an email with SmtpMail.SmtpServer using a server which requires authentication?

P: n/a
Hi,

The following code works fine as long as I don't use a smtp-server which
requires authentication:

Sub sendMail()
Dim sfrom As String = TextBox1.Text
Dim sto As String = TextBox2.Text
Dim ssubject As String = TextBox3.Text
Dim sbody As String = RichTextBox1.Text
Dim omail As New MailMessage
With omail
..From = sfrom
..To = sto
..Subject = ssubject
..Body = sbody
End With
SmtpMail.SmtpServer = ""
Try
SmtpMail.Send(omail)
MsgBox("Alles ok")
Catch ex As System.Web.HttpException
MsgBox(ex.ErrorCode & " - " & ex.ToString)
End Try
End Sub

But I don't know how to use a server which requires authentication. I don't
know how to send the username and the password.

Thanx a lot.

volker jobst
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Volker Jobst" <bu****@gmx.de> wrote in news:Oq3PwXg9DHA.340
@tk2msftngp13.phx.gbl:
But I don't know how to use a server which requires authentication. I don't
know how to send the username and the password.


The .net mail class does not support authentication.

Try Indy, its free and supports about a dozen forms of commonly used auth
schemes:
http://www.indyproject.org/
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.