Click here to Skip to main content
15,883,705 members
Home / Discussions / C#
   

C#

 
QuestionTreeview Control Pin
shehezada7-Jul-08 21:40
shehezada7-Jul-08 21:40 
AnswerRe: Treeview Control Pin
Kjetil Svendsen7-Jul-08 23:42
Kjetil Svendsen7-Jul-08 23:42 
GeneralRe: Treeview Control Pin
shehezada8-Jul-08 3:29
shehezada8-Jul-08 3:29 
GeneralRe: Treeview Control Pin
DaveyM698-Jul-08 4:21
professionalDaveyM698-Jul-08 4:21 
GeneralRe: Treeview Control Pin
Kjetil Svendsen8-Jul-08 21:26
Kjetil Svendsen8-Jul-08 21:26 
QuestionSending mail Pin
hadad7-Jul-08 21:35
hadad7-Jul-08 21:35 
AnswerRe: Sending mail Pin
Ashfield7-Jul-08 22:26
Ashfield7-Jul-08 22:26 
AnswerRe: Sending mail Pin
Anu Palavila7-Jul-08 22:30
Anu Palavila7-Jul-08 22:30 
include

//---------------------------------------------------------------------------

using System.Web.Mail;
public static string SendMail(int pintUserID, string pstrMailTo, string pstrMailBcc,string pstrMailCc,string pstrMailSubject,string pstrMailBody,string pstrAttachFilePath)

{

try

{
MailMessage objMail = new MailMessage();

objMail.From = System.Configuration.ConfigurationSettings.AppSettings["FromEmailID"];

//objMail.From =System.Web.HttpContext.Current.Session["OfficeEmailID"].ToString() ;

objMail.To = pstrMailTo;

objMail.Bcc = pstrMailBcc;

objMail.Cc = pstrMailCc;

objMail.Subject = pstrMailSubject;
MailAttachment Attachment = null;if (File.Exists(pstrAttachFilePath))

{
Attachment = new MailAttachment(pstrAttachFilePath);

}

objMail.Attachments.Add(Attachment);

SmtpMail.SmtpServer = "localhost";//System.Configuration.ConfigurationSettings.AppSettings["SMTPServerIP"];
SmtpMail.Send(objMail);return "TRUE";

}
catch(Exception Ex)

{
return Ex.Message;

}

}





Config file

<add key="SMTPServerIP" value="192.168.1.11">



call the function SendMail & enable your system SMTP server.

Thanks & Regards

GeneralRe: Sending mail Pin
Simon P Stevens8-Jul-08 1:06
Simon P Stevens8-Jul-08 1:06 
AnswerRe: Sending mail Pin
N a v a n e e t h7-Jul-08 22:48
N a v a n e e t h7-Jul-08 22:48 
Questioncan not obtain local variable value in Visual Studio 2008 Pin
George_George7-Jul-08 21:02
George_George7-Jul-08 21:02 
AnswerRe: can not obtain local variable value in Visual Studio 2008 Pin
leppie7-Jul-08 21:06
leppie7-Jul-08 21:06 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
George_George7-Jul-08 21:28
George_George7-Jul-08 21:28 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
leppie7-Jul-08 21:35
leppie7-Jul-08 21:35 
GeneralRe: can not obtain local variable value in Visual Studio 2008 Pin
George_George7-Jul-08 21:47
George_George7-Jul-08 21:47 
QuestionCheck Channel already registered? Pin
ASysSolvers7-Jul-08 21:02
ASysSolvers7-Jul-08 21:02 
QuestionCheck Channel already registered? PinPopular
ASysSolvers7-Jul-08 21:02
ASysSolvers7-Jul-08 21:02 
Questioncreating setup package Pin
Anu Palavila7-Jul-08 20:57
Anu Palavila7-Jul-08 20:57 
QuestionC# / SQL Question - New line in a text field? Pin
Harvey Saayman7-Jul-08 20:54
Harvey Saayman7-Jul-08 20:54 
AnswerRe: C# / SQL Question - New line in a text field? Pin
N a v a n e e t h7-Jul-08 21:37
N a v a n e e t h7-Jul-08 21:37 
GeneralRe: C# / SQL Question - New line in a text field? Pin
Harvey Saayman7-Jul-08 21:47
Harvey Saayman7-Jul-08 21:47 
GeneralRe: C# / SQL Question - New line in a text field? Pin
N a v a n e e t h7-Jul-08 22:47
N a v a n e e t h7-Jul-08 22:47 
QuestionReading values from app.config file [modified] Pin
Tina_K7-Jul-08 20:48
Tina_K7-Jul-08 20:48 
AnswerRe: Reading values from app.config file Pin
Harvey Saayman7-Jul-08 20:58
Harvey Saayman7-Jul-08 20:58 
GeneralRe: Reading values from app.config file Pin
Tina_K8-Jul-08 13:22
Tina_K8-Jul-08 13:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.