Click here to Skip to main content
15,891,935 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
i wrote a web application with c# and Asp.Net to send an emails to multi persons
and i can send email to and cc (just one in the cc)
but i cant send to multi
another i cant put multi emails in the text box by HTML or JavaScript

and this is my Code
C#
protected string toEmail, EmailSubj, EmailMsg,ccId,bccId;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack)
        {
            toEmail = txttomail.Text;
        EmailSubj = Convert.ToString(txtsub.Text);
        EmailMsg = Convert.ToString(txtsub.Text);
        ccId = Convert.ToString(txtcc.Text);
        bccId = Convert.ToString(txtBCC.Text);
        //passing parameter to Email Method
        SendEmail.Email_With_CCandBCC(toEmail,ccId ,bccId ,EmailSubj, EmailMsg);
        Label1.Visible = true;
        Label1.Text = "Email Sent Successfully";

        }
    }
   
    protected void btnreset_Click(object sender, EventArgs e)
    {
        txttomail.Text = "";
        txtsub.Text = "";
        txtsub.Text = "";
        txtBCC.Text = "";
        txtcc.Text = "";
    }
<pre>
Posted
Updated 15-Jun-15 0:55am
v2
Comments
Member 10875212 15-Jun-15 6:56am    
i update my question and put my code
Andy Lanng 15-Jun-15 7:04am    
ok - thanks for that, but I'm confused by your code:
why convert txtsub.Text to string? it should already be a string.
why does txtcc.Text contain an id? shouldn't this be an address?
What does SendEmail.Email_With_CCandBCC do? can we see the code for that?

Thnaks

1 solution

Have a look to the article link-
Sending Emails With Multiple Bcc and CC Using ASP.Net C#[^]
Hope it helps
 
Share this answer
 
Comments
Member 10875212 16-Jun-15 7:42am    
thanks a lot this is what i need but iam still need to design this part to separate automatic after write the next email
Abhishek Pant 16-Jun-15 11:18am    
:)
Member 10875212 17-Jun-15 6:25am    
i am still cant separate the emails
Abhishek Pant 17-Jun-15 10:29am    
Basically what's the issue you are facing on Splitting multiple emails.
Also for more concern if you are using the same method as"SendEmail.Email_With_CCandBCC" in the code please show us to reveal us more what's mess there..

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