473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

If outgoing server requires authentication?

If outgoing server requires authentication,

How can I use smtpmail object in c# ?

I use a windows 2003 server hosting packet somewhere...
string from = "re******@xxx.c om";
string to = UserEMail;
string subject = "Subject";
string body = "Test";
SmtpMail.SmtpSe rver = "smtp.xxx.c om";
SmtpMail.Send(f rom, to, subject, body);
May 20 '06 #1
1 2598
Most of the smarter stmp servers dont allow relays, instead they expect
userid and password for sending particular email. Unfortunately .Net Mail
namespace doesn't provide any of such funcationality, so how we are going to
send emails in case where the stmp requires authentication. The answer lies
in the new property of Mail Message namely 'Fields' which you can find in
Framwork 1.1. You can use fields property of mailmessage like this to provide
credentials

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

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

mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendpassword", "super_secr et") 'set your password here
"Coder" wrote:
If outgoing server requires authentication,

How can I use smtpmail object in c# ?

I use a windows 2003 server hosting packet somewhere...
string from = "re******@xxx.c om";
string to = UserEMail;
string subject = "Subject";
string body = "Test";
SmtpMail.SmtpSe rver = "smtp.xxx.c om";
SmtpMail.Send(f rom, to, subject, body);

May 21 '06 #2

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

Similar topics

10
4739
by: DC Gringo | last post by:
Using latest SP Win2k and .NET versions, I have a .NET application running on server1 with a SQL Server database running on server2. I have the Windows user account passwords sync'd for server1\aspnet (installed by .NET Framework and server2\aspnet (created by me--this machine has no .NET Framework on it). The aspnet user on the database...
4
8527
by: Ravikanth[MVP] | last post by:
Hi It is possible that IIS and SQL Server can reside on Seperate Machines and you can use Integrated Windows Authentication to connect. Ravikanth >-----Original Message-----
1
2364
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 =...
7
2600
by: Wade Wegner | last post by:
Hello, I have been desperately trying to programmatically authenticate a windows user, create their credentials, and then redirect them to a different server while passing the credentials at the same time so that they don't have to login again. Specifically, I have two webservers in the same domain. When I have a user go to Webserver A...
1
1173
by: anony | last post by:
Hi, I'm trying to use system.web.mail to send an email, but the smtp server requires authentication. I cam across some info about extra fields allowed via the following: Dim mail As New MailMessage() mail.To = "to@address.com mail.From = "from@address.com" mail.Subject = "this is a test email."
1
4168
by: Volker Jobst | last post by:
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
3
7759
by: Wild Wind | last post by:
Hello all, I apologise in advance for the long windedness of this post, but I feel that if I am going to get any solution to this problem, it is important that I present as much information that will be useful in diagnosing the problem. I have an application which calls a method of a web service that we host remotely. I have deployed...
2
2099
by: brian.newman | last post by:
I've got an app which provides data based on the user who is logged in. So, I need the user data to be on the same db server as the other data. I'm trying to do this using the membership API. I've set up the tables and sprocs and so forth using the aspnet_regsql.exe (though, for some reason, I had to do it using windows authentication rather...
2
1795
by: =?Utf-8?B?QWJlUg==?= | last post by:
Okay I have a really weird issue. I'm not sure where to post this, but since it's a .NET app I'll try posting it here first. I've written a standard windows forms app to generate emails to a distribution group. Code is clean. The smtp server is using the default port 25, and I'm providing credentials object to the smptclient class. When I...
0
7532
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...
0
7730
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. ...
0
7823
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...
0
6055
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...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
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...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
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
776
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...

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.