从Android调用时,PHP邮件功能无法正常工作

时间:2014-05-02 09:41:49

标签: php android email

我已经在php中编写了与发送无效邮件有关的代码。我应该在系统外部配置邮件服务来发送邮件吗?

$to = "sandeep.v@redpot.in";
$subject = "Asking";
$message = "How do u do";
$header = "From:sanv0428@gmail.com";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true )  
{
    echo "Message sent successfully...";
}
else
{
    echo "Message could not be sent...";
}

我在Android中使用http

的这个php函数
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.1.138/Android/App/getmail.php");

提前感谢您的帮助和时间。

0 个答案:

没有答案