ASP.NET的代码转换 [英] asp.net conversion of code
本文介绍了ASP.NET的代码转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请在Php中转换此代码
Please convert this code in Php
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";
}
}
推荐答案
恐怕我认为没有人愿意为您转换代码.
很明显,ASP.Net代码正在发送电子邮件.
逻辑上的起点应该是Google.搜索使用php发送电子邮件".查看这些文章,您将看到使用@mail命令以PHP发送电子邮件.因此,请搜索"php @mail教程".
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 [ ^ ]
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[^]
这篇关于ASP.NET的代码转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文