Tutorials
Resources
Forum
Communities
Interview
Jobs
Projects
Offshore Development
Silverlight Tutorials
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Himanshu Yadav(...
(100)
Avinash Mohan
(94)
Sriman N Vanga...
(77)
Last 7 Days
Tejinder Singh ...
(435)
Babu Akkandi
(412)
Appukuttan
(407)
more...
New Feature:
Community Sites
:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
problem in Sending email in asp.net
Posted Date:
22 Nov 2008
Total Responses:
1
Posted By:
guddu
Member Level:
Silver
Points
: 1
hi have created email application in asp.net 2.0
it works fine but it only sent mail to gmail
not any oother like rediff or yahoo
im sending code
thnk u
protected void btnMail_Click(object sender, EventArgs e)
{
if (txtFrom.Text.Trim() == "")
{
lblResult.Text = "Please Enter E-mail from address.";
}
else if (txtTo.Text.Trim() == "")
{
lblResult.Text = "Please Enter E-mail to address.";
}
else if (txtSubject.Text.Trim() == "")
{
lblResult.Text = "Please Enter the subject.";
}
//else if (txtMessage.Text.Trim() == "")
//{
// lblResult.Text = "Please Enter The message";
//}
else if (FreeTextBox1.Text=="")
{
lblResult.Text = "please enter The Message";
}
try
{
MailMessage msg = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, FreeTextBox1.Text);
msg.IsBodyHtml = true;
//if (fileUpload.PostedFile.FileName == "")
//{
//}
//else
//{
// msg.Attachments.Add(new System.Net.Mail.Attachment(fileUpload.PostedFile.FileName));
// //msg.Attachments.Add(Attachment(fileUpload.PostedFile.FileName));
//}
SmtpClient mySmtp = new SmtpClient("192.168.0.249");
mySmtp.Send(msg);
lblResult.Text = "Message Sent";
}
catch(Exception ex)
{
lblResult.Text = ex.Message;
}
}
Responses
Author:
Pradnya
22 Nov 2008
Member Level:
Silver
Rating:
Points
: 1
The mail must have sent but with yohoo or rediff it might be sent as junk mail.
Post Reply
You must
Sign In
to post a response.
Next :
How to alort a message when user not selected any checkbox.?
Previous :
How to count the number of checkboxes that are checked by user?
Return to Discussion Forum
Post New Message
Category:
ASP.NET
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
dotNet Slackers
BizTalk Adaptors
Web Design
Contact Us
Privacy Policy
Terms Of Use