如何以编程方式将消息发送到我的电子邮件


How to send a message to my e-mail programmatically

我需要一些帮助来通过php向电子邮件发送消息。这是我目前掌握的代码:

 <?php
 $newline = $_GET['message'];
$newline = str_replace("[N]","'n"
,"$newline");
$newline = str_replace("[n]","'n"
,"$newline");
mail($_GET['to'],$_GET[
'subject'],$newline,"From: ".$_GET['from']);
echo "<FONT FACE='"Verdana'" SIZE='"2'">".$_GET[
'thanks']."</FONT>";?>

我将这个php代码上传到服务器,然后使用execute_shell()函数通过定义各种变量将消息发送到我的电子邮件。这是代码:

msg_to="linera@low.com";
msg_from="celebraces@gmail.com";
msg_subject="Hey, what's up?";
msg_message="This is a test email :D";
msg_thanks="Your message has been sent :D";
    execute_shell("http://yourserver.com.au/
yourgame/sendmail.php?to="+msg_to+"&from="
   +msg_from+"&subject="+msg_subject+"&
message="+msg_message+"&thanks="+msg_thanks,"");

问题是,当消息完成时,它只显示msg_thanks,我将其定义为一个变量。我是php的新手,不太了解。我想做的就是删除这个,而是在消息完成后将用户重定向到一个特定的感谢网页。我该怎么做?

尝试header():

header("location:../thankyou.php");