473,394 Members | 1,774 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,394 software developers and data experts.

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.com";
string to = UserEMail;
string subject = "Subject";
string body = "Test";
SmtpMail.SmtpServer = "smtp.xxx.com";
SmtpMail.Send(from, to, subject, body);
May 20 '06 #1
1 2593
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.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication

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

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret") '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.com";
string to = UserEMail;
string subject = "Subject";
string body = "Test";
SmtpMail.SmtpServer = "smtp.xxx.com";
SmtpMail.Send(from, 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
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...
4
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
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...
7
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...
1
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...
1
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...
3
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...
2
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. ...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.