Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to send group mails from a web application using c#.net?
Posted

 
Share this answer
 
v2
Freind try this following links:

http://forums.asp.net/t/971802.aspx[^]
http://stackoverflow.com/questions/6620467/asp-net-c-sharp-code-to-send-mail-to-multiple-users-whose-mail-id-should-be-hid[^]
http://bradkingsley.com/sending-email-from-asp-net-4-c-sample-code/[^]
http://www.orcsweb.com/blog/brad/sending-email-from-asp-net-4-c-sample-code/[^]
http://www.velocityreviews.com/forums/t118435-sending-e-mails-from-asp-net-2-0-page-using-system-net-mail.html[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=65[^]

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SendMail.aspx.cs" Inherits="SendMail" %><html><head runat="server"><title>Email Test Page</title></head><body>    <form id="form1" runat="server">        Message to: <asp:TextBox ID="txtTo" runat="server" /><br>        Message from: <asp:TextBox ID="txtFrom" runat="server" /><br>        Subject: <asp:TextBox ID="txtSubject" runat="server" /><br>        Message Body:<br>        <asp:TextBox ID="txtBody" runat="server" Height="171px" TextMode="MultiLine" Width="270px" /><br>        <asp:Button ID="Btn_SendMail" runat="server" onclick="Btn_SendMail_Click" Text="Send Email" /><br>        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>    </form></body></html>
C#




using System;
using System.Web.UI.WebControls;
using System.Net.Mail;
public partial class SendMail : System.Web.UI.Page
{    
  protected void Btn_SendMail_Click(object sender, EventArgs e)    {
        MailMessage mailObj = new MailMessage(txtFrom.Text,      
              txtTo.Text,txtSubject.Text, txtBody.Text);
        SmtpClient SMTPServer = new SmtpClient("localhost");        
         try {
                SMTPServer.Send(mailObj);        
             }            
         catch (Exception ex) {
                Label1.Text = ex.ToString();        
             }    
 }
}
C#




Thanks,
Ambesha
 
Share this answer
 
v2
Try the link below.


Send Email in ASP.Net 2.0 - Feed back Form[^]

Just add a new "To" or "CC" for each member in the list?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900