cs file mail class------->>>>
private void SendEmail( string ccAddress, string bccAddress, string subject, string body, MailPriority priority, bool isHtml)
{
try
{
SmtpClient smtpClient = new SmtpClient();
using (MailMessage message = new MailMessage())
{
MailAddress fromAddress = new MailAddress("geniuscreatorsreport@yahoo.in", "FingerPrint By GeniusCreators's User");
// You can specify the host name or ipaddress of your server
smtpClient.Host = "smtp.mail.yahoo.com"; //you can also specify mail server IP address here
//Default port will be 25
smtpClient.Port = 25;
NetworkCredential info = new NetworkCredential("geniuscreatorsreport@yahoo.in", "########");
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = info;
//From address will be given as a MailAddress Object
message.From = fromAddress;
message.Priority = priority;
// To address collection of MailAddress
message.To.Add("sourabh.ghosh49@gmail.com");
message.Subject = subject + " " + "Message From" + " " + Session["Rid"].ToString()+" " + "(" + Session["FirstName"].ToString()+")";
if (ccAddress.Length > 0)
{
message.CC.Add(ccAddress);
}
if (bccAddress.Length > 0)
{
message.Bcc.Add(bccAddress);
}
//Body can be Html or text format
//Specify true if it is html message
message.IsBodyHtml = isHtml;
// Message body content
message.Body = body + " " + " " + "\n Regards :"+"\n RegistrationID :" + " " + Session["Rid"].ToString() + " " + "\n(" + Session["FirstName"].ToString() + ")";
// Add the attachment, if any
//if (FileUpload1.PostedFile.ContentLength > 0)
//{
// Attachment attachment = new Attachment(Path.GetFullPath(FileUpload1.PostedFile.FileName));
// message.Attachments.Add(attachment);
//}
if (FileUpload1.HasFile)
{
message.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.FileName));
}
// Send SMTP mail
smtpClient.Send(message);
}
}
catch (Exception ee)
{
lblStatus.Text = "Message Sending Failed";
lblStatus.ForeColor = Color.Red;
return;
}
}
web.config--->>>
<system.web>
<httpRuntime maxRequestLength="10000" executionTimeout="1800" />
</system.web>
plz help me.....
sourabh