我对php的编码有问题。我对php/html网页还是个新手。我在youtube上从德里克·阿布切里爵士那里得到了修改和提示:
链接是:https://www.youtube.com/watch?v=m-_bazdyey4
我的问题是如何获得gmail的身份验证。我试图改变,但我现在仍然得到答案,以下是代码:
谢谢您
<?php
header('Content-type: application/json');
$status = array(
'type'=>'success',
'message'=>'Email sent!'
);
$name = @trim(stripslashes($_POST['name']));
$email = @trim(stripslashes($_POST['email']));
$subject = @trim(stripslashes($_POST['subject']));
$message = @trim(stripslashes($_POST['message']));
$email_from = $email;
$email_to = 'shirokamikaze111@gmail.com';
$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;
$success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>');
echo json_encode($status);
die;
暂无答案!
目前还没有任何答案,快来回答吧!