Click here to Skip to main content
15,893,814 members
Home / Discussions / C#
   

C#

 
QuestionHow to send a mail with authentication Pin
quiteSmart9-Oct-06 19:46
quiteSmart9-Oct-06 19:46 
Hi all,

I need to know how to authenticate a user before sending a mail using a
C# application. The authentication should be done after sending mail order is initiated. or in other case if possible i need to know how to get the user name and password from the session that the user is signed in to.

The source code i use is this:

private void sendMailButton_Click(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new
MailMessage(toTextBox.Text, fromTextBox.Text, subjectTextBox.Text,
bodyTextBox.Text);

SmtpClient obj = new SmtpClient(SMTPTextBox.Text);
obj.Send(mailMessage);
MessageBox.Show("Message Sent");

}
catch (Exception ex)
{
MessageBox.Show("message not sent");

}
}

I need to add the authentication part. This is working but with no
authentication for the user or the mail sender address. I am using a
local SMTP server.
Thanks,


Jamil abou khalil
AnswerRe: How to send a mail with authentication Pin
Ashish Derhgawen10-Oct-06 6:17
Ashish Derhgawen10-Oct-06 6:17 
GeneralRe: How to send a mail with authentication Pin
quiteSmart10-Oct-06 20:26
quiteSmart10-Oct-06 20:26 
GeneralRe: How to send a mail with authentication Pin
Ashish Derhgawen11-Oct-06 7:48
Ashish Derhgawen11-Oct-06 7:48 
QuestionLaunching a website with a specific referer... Pin
omenrust9-Oct-06 19:18
omenrust9-Oct-06 19:18 
AnswerRe: Launching a website with a specific referer... Pin
Stefan Troschuetz9-Oct-06 21:44
Stefan Troschuetz9-Oct-06 21:44 
GeneralRe: Launching a website with a specific referer... Pin
omenrust10-Oct-06 11:48
omenrust10-Oct-06 11:48 
GeneralRe: Launching a website with a specific referer... Pin
Stefan Troschuetz10-Oct-06 22:14
Stefan Troschuetz10-Oct-06 22:14 
Questionremote registry access problem Pin
RanjithLogics9-Oct-06 18:27
RanjithLogics9-Oct-06 18:27 
AnswerRe: remote registry access problem Pin
abhinish9-Oct-06 19:52
abhinish9-Oct-06 19:52 
GeneralRe: remote registry access problem Pin
RanjithLogics9-Oct-06 22:40
RanjithLogics9-Oct-06 22:40 
QuestionSoftware Protection Pin
Charith Jayasundara9-Oct-06 17:59
Charith Jayasundara9-Oct-06 17:59 
AnswerRe: Software Protection Pin
Malcolm Smart9-Oct-06 20:55
Malcolm Smart9-Oct-06 20:55 
QuestionCreate Deployment Package Pin
oskardiazdeleon9-Oct-06 17:26
oskardiazdeleon9-Oct-06 17:26 
Questionexecuting an PHP file on the webserver [modified] Pin
asamay9-Oct-06 15:00
asamay9-Oct-06 15:00 
AnswerRe: executing an PHP file on the webserver Pin
mikone9-Oct-06 21:49
mikone9-Oct-06 21:49 
GeneralRe: executing an PHP file on the webserver Pin
asamay10-Oct-06 6:37
asamay10-Oct-06 6:37 
QuestionInterface with MSN Messenger Pin
cdenvir9-Oct-06 13:51
cdenvir9-Oct-06 13:51 
QuestionSetting Desktop Wallpaper Pin
monrobot139-Oct-06 13:34
monrobot139-Oct-06 13:34 
AnswerRe: Setting Desktop Wallpaper Pin
Stefan Troschuetz9-Oct-06 21:51
Stefan Troschuetz9-Oct-06 21:51 
GeneralRe: Setting Desktop Wallpaper Pin
monrobot1310-Oct-06 16:07
monrobot1310-Oct-06 16:07 
QuestionInterface for equality(only) comparisons Pin
Dan Neely9-Oct-06 10:30
Dan Neely9-Oct-06 10:30 
AnswerRe: Interface for equality(only) comparisons Pin
Guffa9-Oct-06 10:41
Guffa9-Oct-06 10:41 
GeneralRe: Interface for equality(only) comparisons Pin
Dan Neely9-Oct-06 11:03
Dan Neely9-Oct-06 11:03 
Questionhow to protect application .... Pin
galigal159-Oct-06 10:06
galigal159-Oct-06 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.