Click here to Skip to main content
15,914,401 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: User Control with Custom Tags Pin
LagoonMatt14-Jan-07 8:11
LagoonMatt14-Jan-07 8:11 
GeneralRe: User Control with Custom Tags Pin
minhpc_bk14-Jan-07 14:02
minhpc_bk14-Jan-07 14:02 
GeneralRe: User Control with Custom Tags Pin
LagoonMatt15-Jan-07 9:43
LagoonMatt15-Jan-07 9:43 
GeneralRe: User Control with Custom Tags Pin
minhpc_bk15-Jan-07 11:38
minhpc_bk15-Jan-07 11:38 
Questionplzz write a simple function on.......... Pin
manish srivastava11-Jan-07 6:13
manish srivastava11-Jan-07 6:13 
AnswerRe: plzz write a simple function on.......... Pin
ednrgc11-Jan-07 7:03
ednrgc11-Jan-07 7:03 
GeneralRe: plzz write a simple function on.......... Pin
Colin Angus Mackay11-Jan-07 12:20
Colin Angus Mackay11-Jan-07 12:20 
AnswerRe: plzz write a simple function on.......... Pin
rockford.boulderdash11-Jan-07 8:40
rockford.boulderdash11-Jan-07 8:40 
There you go, enjoy Smile | :)
=============================================

using System.Net.Mail;

public static void SendMailMessage(string sMailBody, string sFromAddress, string sFromName,
string[] sToAddress, string[] sCC, string[] sBCC, string sSubject, bool IsHTML)
{
SmtpClient objSMTPClient = new SmtpClient("localhost");
MailMessage objMessage = new MailMessage();

try
{
MailAddress objFromAddress = new MailAddress(sFromAddress, sFromName);

// From address will be given as a MailAddress Object
objMessage.From = objFromAddress;

// To address collection of MailAddress
for (int i = 1; i <= sToAddress.Length; i++)
{
objMessage.To.Add(sToAddress[i - 1]);
}

// CC and BCC optional
// MailAddressCollection class is used to send the email to various users
// You can specify Address as new MailAddress("user@host.com")
if (sCC != null)
{
if (sCC.Length > 0)
{
for (int i = 1; i <= sCC.Length; i++)
{
objMessage.CC.Add(sCC[i - 1]);
}
}
}
if (sBCC != null)
{
if (sBCC.Length > 0)
{
for (int i = 1; i <= sBCC.Length; i++)
{
objMessage.Bcc.Add(sBCC[i - 1]);
}
}
}

// Body can be html or text format
if (IsHTML)
objMessage.IsBodyHtml = true;

objMessage.Subject = sSubject;
objMessage.Body = sMailBody;

// Send SMTP mail
objSMTPClient.Send(objMessage);
}
catch
{
}
}


My blog: http://www.asaf.co.il
GeneralRe: plzz write a simple function on.......... Pin
Not Active11-Jan-07 8:42
mentorNot Active11-Jan-07 8:42 
GeneralRe: plzz write a simple function on.......... Pin
rockford.boulderdash11-Jan-07 8:47
rockford.boulderdash11-Jan-07 8:47 
GeneralRe: plzz write a simple function on.......... Pin
Not Active11-Jan-07 8:57
mentorNot Active11-Jan-07 8:57 
GeneralRe: plzz write a simple function on.......... Pin
_AK_11-Jan-07 17:18
_AK_11-Jan-07 17:18 
AnswerRe: plzz write a simple function on.......... Pin
saravanan0511-Jan-07 9:09
saravanan0511-Jan-07 9:09 
QuestionPaypal buynow control's IPN notify_url Pin
Nadia Monalisa11-Jan-07 5:12
Nadia Monalisa11-Jan-07 5:12 
Questionimages with sessions in asp Pin
ADY00711-Jan-07 4:27
ADY00711-Jan-07 4:27 
AnswerRe: images with sessions in asp Pin
Britney S. Morales11-Jan-07 11:48
Britney S. Morales11-Jan-07 11:48 
QuestionSSL Pin
DBNashville11-Jan-07 4:23
DBNashville11-Jan-07 4:23 
Questionasp.net validations Pin
P Bhasker11-Jan-07 3:42
P Bhasker11-Jan-07 3:42 
AnswerRe: asp.net validations Pin
_AK_11-Jan-07 3:45
_AK_11-Jan-07 3:45 
GeneralRe: asp.net validations Pin
P Bhasker11-Jan-07 3:52
P Bhasker11-Jan-07 3:52 
GeneralRe: asp.net validations Pin
sanaziuse11-Jan-07 4:07
sanaziuse11-Jan-07 4:07 
Questionhow to use application state and session state Pin
Rmesh11-Jan-07 2:41
Rmesh11-Jan-07 2:41 
AnswerRe: how to use application state and session state Pin
_AK_11-Jan-07 2:50
_AK_11-Jan-07 2:50 
AnswerRe: how to use application state and session state [modified] Pin
Skanless11-Jan-07 9:32
Skanless11-Jan-07 9:32 
QuestionCustomize the Calendar Control Pin
RX Maverick11-Jan-07 2:21
RX Maverick11-Jan-07 2:21 

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.