Click here to Skip to main content
16,004,901 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to use FileUpload Pin
MarcelloTurnbull31-Dec-08 3:03
MarcelloTurnbull31-Dec-08 3:03 
GeneralRe: How to use FileUpload Pin
MarcelloTurnbull31-Dec-08 3:04
MarcelloTurnbull31-Dec-08 3:04 
AnswerRe: How to use FileUpload - I got it Pin
Muhammad Gouda31-Dec-08 3:19
Muhammad Gouda31-Dec-08 3:19 
QuestionProblem With Embedding .NET ActiveXcontrol (Window user control) inside aspx Pin
Dattatraya K31-Dec-08 1:30
Dattatraya K31-Dec-08 1:30 
AnswerCrosspost : Please ignore Pin
Brij31-Dec-08 2:14
mentorBrij31-Dec-08 2:14 
QuestionAuto send Emails Pin
kavitha_blueindia31-Dec-08 1:05
kavitha_blueindia31-Dec-08 1:05 
AnswerRe: Auto send Emails Pin
Abhijit Jana31-Dec-08 1:09
professionalAbhijit Jana31-Dec-08 1:09 
GeneralRe: Auto send Emails Pin
Tamer Oz31-Dec-08 1:32
Tamer Oz31-Dec-08 1:32 
You can use the method below.

C#
public void SendMail(string smtpAddress, string from,string to, string cc, string bcc, string body, string subject, bool isHtml,string attachmentFileNames)
{
SmtpClient insSmtpClient = new SmtpClient(smtpAddress);
MailMessage insMailMessage = new MailMessage();
insMailMessage.From = new MailAddress(from);
foreach (string strBcc in bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Bcc.Add(strBcc);
}
foreach (string strTo in to.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.To.Add(strTo);
}
foreach (string strCc in cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.CC.Add(strCc);
}
insMailMessage.Body = body;
insMailMessage.Subject = subject;
insMailMessage.IsBodyHtml = isHtml;

foreach (string strAtt in attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Attachments.Add(new Attachment(strAtt));
}
insSmtpClient.Send(insMailMessage);
}

Kopyala

--------------------------------------------------------------------------------
VB.Net
Public Sub SendMail(ByVal smtpAddress As String, ByVal from As String, ByVal [to] As String, ByVal cc As String, ByVal bcc As String, ByVal body As String, _
ByVal subject As String, ByVal isHtml As Boolean, ByVal attachmentFileNames As String)
Dim insSmtpClient As New SmtpClient(smtpAddress)
Dim insMailMessage As New MailMessage()
insMailMessage.From = New MailAddress(from)
For Each strBcc As String In bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Bcc.Add(strBcc)
Next
For Each strTo As String In [to].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.[To].Add(strTo)
Next
For Each strCc As String In cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.CC.Add(strCc)
Next
insMailMessage.Body = body
insMailMessage.Subject = subject
insMailMessage.IsBodyHtml = isHtml

For Each strAtt As String In attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Attachments.Add(New Attachment(strAtt))
Next
insSmtpClient.Send(insMailMessage)
End Sub
GeneralRe: Auto send Emails Pin
Abhijit Jana31-Dec-08 1:47
professionalAbhijit Jana31-Dec-08 1:47 
GeneralRe: Auto send Emails Pin
ednrg31-Dec-08 8:08
ednrg31-Dec-08 8:08 
AnswerRe: Auto send Emails Pin
Christian Graus31-Dec-08 17:14
protectorChristian Graus31-Dec-08 17:14 
QuestionAccess provider for Roles [modified] Pin
scothykonma31-Dec-08 0:12
scothykonma31-Dec-08 0:12 
QuestionUnhandled Exception how to solve it?? Pin
mr_muskurahat31-Dec-08 0:11
mr_muskurahat31-Dec-08 0:11 
AnswerRe: Unhandled Exception how to solve it?? Pin
Abhijit Jana31-Dec-08 0:24
professionalAbhijit Jana31-Dec-08 0:24 
AnswerRe: Unhandled Exception how to solve it?? Pin
Brij31-Dec-08 0:31
mentorBrij31-Dec-08 0:31 
GeneralRe: Unhandled Exception how to solve it?? Pin
mr_muskurahat31-Dec-08 0:44
mr_muskurahat31-Dec-08 0:44 
GeneralRe: Unhandled Exception how to solve it?? Pin
Brij31-Dec-08 1:46
mentorBrij31-Dec-08 1:46 
QuestionHow to deploy ASP.NET site ??? Pin
bonypatel30-Dec-08 20:02
bonypatel30-Dec-08 20:02 
AnswerRe: How to deploy ASP.NET site ??? Pin
Abhijit Jana30-Dec-08 20:07
professionalAbhijit Jana30-Dec-08 20:07 
AnswerRe: How to deploy ASP.NET site ??? Pin
N a v a n e e t h30-Dec-08 20:37
N a v a n e e t h30-Dec-08 20:37 
GeneralRe: How to deploy ASP.NET site ??? Pin
mr_muskurahat31-Dec-08 0:16
mr_muskurahat31-Dec-08 0:16 
Questionhow to remove a perticular page in cache. Pin
dotnetvamshidhar30-Dec-08 19:20
dotnetvamshidhar30-Dec-08 19:20 
AnswerRe: how to remove a perticular page in cache. Pin
Brij30-Dec-08 19:48
mentorBrij30-Dec-08 19:48 
AnswerRe: how to remove a perticular page in cache. Pin
N a v a n e e t h30-Dec-08 20:39
N a v a n e e t h30-Dec-08 20:39 
QuestionPermission error when creating folder through vb.net code Pin
hozsam30-Dec-08 19:15
hozsam30-Dec-08 19:15 

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.