Hi all,
I have the following code to send an email from a web interface and it works fine. However, I want to know if it's possible to replace the email address specified in "Mail.From" by the default client email address. If yes, how do I do that?
SmtpMail.SmtpServer = "localhost";
MailMessage Mail = new MailMessage();
Mail.From = "yourname@company.com"; <-- would like default client email address here
Mail.To = "manager@company.com";
Mail.Subject = "New Project from " + lblUser.Text;
Mail.Body = "Hi," + "\n" + "A new project requested by " + lblUser.Text + " on " + lblDate.Text;
try
{
SmtpMail.Send(Mail);
}
catch (Exception ex)
{
Response.Write("Exception occured: " + ex);
}
thanks,
A.
I have the following code to send an email from a web interface and it works fine. However, I want to know if it's possible to replace the email address specified in "Mail.From" by the default client email address. If yes, how do I do that?
SmtpMail.SmtpServer = "localhost";
MailMessage Mail = new MailMessage();
Mail.From = "yourname@company.com"; <-- would like default client email address here
Mail.To = "manager@company.com";
Mail.Subject = "New Project from " + lblUser.Text;
Mail.Body = "Hi," + "\n" + "A new project requested by " + lblUser.Text + " on " + lblDate.Text;
try
{
SmtpMail.Send(Mail);
}
catch (Exception ex)
{
Response.Write("Exception occured: " + ex);
}
thanks,
A.