473,594 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Authentication for SMTP Server using system.web.mail

I'm trying to use system.web.mail to send an email, but the smtp
server
requires authentication. I came across some info about fields
property

Dim mail As New MailMessage()
mail.To = "to@address .com
mail.From = "fr**@address.c om"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/smtpauthenti
cate", "1") 'basic authentication

mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendusername
", "username") 'set your username here

mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendpassword
", "password") 'set your password here
SmtpMail.SmtpSe rver = "smtp.domain.co m" 'your real server goes here
SmtpMail.Send(m ail)
I get a compilation error:

'Fields' is not a member of 'System.Web.Mai l.MailMessage'

Even though I have installed .Net Framework 1.1, i am not able to
compile the code. Can anybody help me on this.
Thanks in advance.
Ash
Nov 18 '05 #1
0 1447

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2041
by: Phil | last post by:
I've set up a form which sends info to my email address usind CDO 2000 w/ authentication which takes about 10 seconds for the message to get sent. Any suggestions? I can't afford the commercial components. Thanks ---
1
2365
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>" & _
2
1489
by: Radi Ivanov | last post by:
Hello, I am trying to send an e-mail message via code using the following two lines: ************************************************************************ SmtpMail.SmtpServer = "smtp.mail.yahoo.com"; SmtpMail.Send("Radi@localhost.com", job.EmailAddress.Trim(), "Job Results #" + job.JobID, msg); ************************************************************************
0
1708
by: amallik | last post by:
//The following 3 lines of codes necessary if smtp server needs authenticatio mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication for smtp serve mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "your_username"); //set your username here for the smtp serve mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",...
0
1083
by: hyper | last post by:
The MailMessage class in System.Web.Mail in asp.net 1.1 doesn't contain any API that perform authentication. I found an article about this subject: How to enable SMTP Authentication using System.Web.Mail at http://support.microsoft.com/default.aspx?scid=kb;en-us;555287 . I've tried that approach, yet failed. Following are the key section of its sample code: msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",...
34
18205
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
1
14349
by: Jeff | last post by:
I am receiving the following error: // error: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 No AUTH command has been given. How do I provide the Client Authentication with the code below. private void SendEmail2()
0
1121
by: aravindansubramaniyam | last post by:
Hi, I'm using the following code in vb.Net for sending a mail. Its sending the mail from my system. but not sending in the server machine. In the server machine, "Server responses 5.7.3 Authentication Unsuccessful" error comes. Where I've mistaken in the code. But the username and password are same. Dim mail As New MailMessage() Dim smtp As New SmtpClient("***.***.com") mail.From = New...
4
2984
by: eruth | last post by:
Hi all, I'm trying to send an e-mail from a vb.net web form. I can create the message, but when it comes to actually sending it I get the following error. "Mailbox name not allowed. The server response was: Server policy dictates you must authenticate first " So far as I can tell, my code is doing what it's meant to, but I'd appreciate someone casting an eye over it to make sure. This is based on a couple of examples found through...
0
8259
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
8377
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
8016
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
8244
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
6669
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3871
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
3905
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
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
0
1218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.