Click here to Skip to main content
15,922,419 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Please convert this code in Php
C#
protected void btnSubmit_Click(object sender, EventArgs e)
    {
        MailMessage feedBack = new MailMessage();
        feedBack.To.Add("rakesh.rakeshkumar1989@gmail.com");
        feedBack.CC.Add("kamalpal60@yahoo.com");
        feedBack.Bcc.Add("manishsingh.kumar56@gmail.com");
        feedBack.From = new MailAddress("kamalpal60@yahoo.com");
        feedBack.Subject = txtSubject.Text;

        feedBack.Body = "Sender Name: " + txtName.Text + "<br /><br />Sender Email: " + txtMail.Text + "<br /><br />" + txtMessage.Text;
        feedBack.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient();
        smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
        smtp.Port = 587;
        smtp.EnableSsl = true;
        smtp.Credentials = new System.Net.NetworkCredential("manishsingh@gmail.com", "ascd");
        //Or your Smtp Email ID and Password
        smtp.Send(feedBack);
        Label1.Text = "Thanks for contacting us";
    }
}
Posted
Updated 5-Oct-12 0:22am
v2
Comments
M@anish 5-Oct-12 6:28am    
hello Sir I need your Help
Give any hint to convert this code

1 solution

I'm afraid I don't think anyone will be prepared to convert your code for you.

It's clear the ASP.Net code is sending an e-mail.

A logical place to start would be google. Search "sending e-mail using php". Looking at these article you'll see e-mails are send in PHP using the @mail command. So then search "php @mail tutorial".

http://www.dreamincode.net/forums/topic/10130-send-emails-using-php-basic/[^]

http://webcheatsheet.com/php/send_email_text_html_attachment.php[^]

http://carbonize.co.uk/Lazarus/Forum/index.php?topic=1444.0[^]

http://php.net/manual/en/function.mail.php[^]
 
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