Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
ffttt
Home
>>
Forum
>>
ASP.Net
>>
Post New Question
Subscribe to Forum
Mail
Posted By:
Shweta
Posted Date:
January 27, 2011
Points:
2
Category :
ASP.Net
i m having enquiry form in my website.
after clicking the submit button the mail goes to the correct mail address but the in 'from' tag its showing the same email address as that of the destination mail address
thus 'to' and 'from' has the same email address inspite of the different address filled in the form.
the code of the button_click() is as below:
protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress("abc@xyz.com"));
msg.From = new MailAddress(txtEmail.Text);
msg.Subject = txtSubject.Text;
msg.Body = txtName.Text + Environment.NewLine + txtMessage.Value;
SmtpClient client = new SmtpClient();
client.Host = "smtp.xyz.com";//Place your smtp server in quotation marks (i.e. "smtp.live.com")
client.Port = 587;// Place your smtp port here, i.e. hotmail's smtp port is 587
client.Credentials = new NetworkCredential("username","password");
client.EnableSsl = true;
client.Send(msg);
}
plz help to resolve.
Responses
Author:
Amit Mehra
Posted Date: January 30, 2011 Points: 5
Hi,
Thats strange..Check the from email address properly..It can not be the same.
Thanks,
Amit
Please "
Mark As Answer
" if this post help you.
Author:
Blessy Baby
Posted Date: February 01, 2011 Points: 5
hi,
Please check are you entering the same address in the textbox.
Blessy Baby
Project Lead
Digitalmesh Softech India (p) Limited
Cochin,Kerala
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
How to Send Mail Asynchronously in asp.net
how to send e-mail from site to admin
How to validate textBox for E-mail Id in C#.net
Sending Mail
Sending Mail
.NET Service Application - Sending mail to 2,634,789 users
difference between system.web.mail and system.net.mail?
Automatic Mail Send on Scheduled Date time in Asp.net
Send Mail Promting throw out-look
Send mail using javascript
Latest Forum Questions From The Same Category
Certification
how to learn and Where can i Learn about ASP .Net
Slash(/) in Combobox
attaching the report in the web page
How do i get payment status in redirect page using bitpay?
Login with Facebook and Save details in database
Login with facebook account in my website
upload image
How to make a nested datalist control?
What class does Icon derive from?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend