473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
1 4156
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
1
by: Rodrigo | last post by:
I'm trying to send an email message using my SMTP server that requires authentication. How can I do that? My code is: Dim email As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage...
6
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New...
1
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
4
by: Max | last post by:
hi I am using System.Web.Mail.MailMessage with System.Web.Mail.SmtpMail to send mail. now the my question is, Is it compulsory to add fields smtpauthenticate, sendusername and sendpassword...
3
by: sentiboy | last post by:
I am using the following code for sending email through mapi in VS 2005 environment: Public objSession As New MSMAPI.MAPISession Public objMessage As New MSMAPI.MAPIMessages ...
0
by: sugee | last post by:
Hi, I need to send email in ASP .net(vb .net) using smtp. i have found that i can use smtpmail.send() to send email.....but the problem is the page doent show any error and the mail is not...
3
by: sugee | last post by:
Hi, I need to send email in ASP .net(vb .net) using smtp. i have found that i can use smtpmail.send() to send email.....but the problem is the page doent show any error and the mail is not...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.