Re: [EZLINK] sending mail giving trouble in asp.net
Hi
Please try this
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class mail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string status = SubmitOrderMail();
lblStatus.Text = status;
}
public static string SubmitOrderMail()
{
string mailstatus;
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
string mail_message = "Hello";
mail_message = "Dear user,<br><br>";
mail_message += "If you have questions concerning this code please contact <a href=mailto:sijumonabraham@yahoo.com>Support</a><br><br>";
mail_message += "Regards<br>";
mail_message += "support team";
try
{
MailAddress fromAddress = new MailAddress("from@yahoo.com");
smtpClient.Host = "mailhost.muc.infineon.com";
message.From = fromAddress;
message.To.Add("toaddress@yahoo.com");
message.Subject = "Feedback";
message.CC.Add("cc_address@yahoo.com");
message.Bcc.Add(new MailAddress("bcc_address@yahoo.com"));
message.IsBodyHtml = true;
message.Body = mail_message;
smtpClient.Send(message);
return mailstatus = "Email successfully sent.";
}
catch (Exception ex)
{
return mailstatus = "Send Email Failed.<br>" + ex.Message;
}
}
}
ASPNET 2.0 we use System.Net.Mail instead of System.Web.Mail
Thanks & Regards
Sijumon Abraham
May Lord Jesus Bless you
s priya <spriya1900@yahoo.com> wrote:
hai,
in visul studio 2005 it is difficult to sending mails i got some samples from web not working . any body can help? pls send details with smtp config, coding
thanks
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[Non-text portions of this message have been removed]
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ezlink/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ezlink/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:ezlink-digest@yahoogroups.com
mailto:ezlink-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
ezlink-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to: