473,785 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send an email with SmtpMail.SmtpSe rver 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.Te xt
Dim omail As New MailMessage
With omail
..From = sfrom
..To = sto
..Subject = ssubject
..Body = sbody
End With
SmtpMail.SmtpSe rver = ""
Try
SmtpMail.Send(o mail)
MsgBox("Alles ok")
Catch ex As System.Web.Http Exception
MsgBox(ex.Error Code & " - " & 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 4184
"Volker Jobst" <bu****@gmx.d e> wrote in news:Oq3PwXg9DH A.340
@tk2msftngp13.p hx.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/
"Programmin g 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
4311
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, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
1
2373
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 email.From = "me@mydomain.com.br" email.To = txtemail.Text email.Subject = "We have receveid your comments" email.BodyFormat = System.Web.Mail.MailFormat.Html email.Body ="<html>" & _
6
2455
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 MailMessage() With oMail .From = "mypc@baxglobal.com" .To = "ceckman@baxglobal.com"
1
6292
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 SmtpMail.Send"mymail@gmx.net", "somebody@xxx.ch", "sub",
14
9143
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 local default SMTP Server and my from address is a valid Yahoo/Hotmail address. I have configures the local SMTP Server to allow the IP Address 127.0.0.1.
4
2367
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 fields to MailMessage Object????. mm.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
3
4705
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 objSession.DownLoadMail = False objSession.UserName = "MyUsername" objSession.Password = "MyPassword" objSession.SignOn()
0
895
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 received in my inbox too.....i have changed some settings in IIS(default virtual server properties). In the access tab->and on connection i have added 127.0.0.1 ip address....but i have a doubt......do i need to add this 127.0.0.1 ip or my mail server...
3
1524
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 received in my inbox too.....i have changed some settings in IIS(default virtual server properties). In the access tab->and on connection i have added 127.0.0.1 ip address....but i have a doubt......do i need to add this 127.0.0.1 ip or my mail server...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.