我知道这是一个经常被问到的问题,但我已经完成了其他线程中的步骤,但它似乎没有帮助。一直在努力奋斗这一周,真的很感激帮助!
以下是关键部分:
我认为SMTP设置可能有误,但Bluehost支持说他们不能直接更改这些。详情如下......
PHP代码
<?php
//ERROR REPORTING
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
//POST VALUES
$name=$_POST['name'];
$business=$_POST['business_name'];
$email=$_POST['email_address'];
$subject='[CONTACT PAGE] '
.strtoupper($_POST['subject'])
.' request from $name'
.' ($business)';
// The above variables confirmed to all POST
$message = '[name] '.$name.'\n'
.'[business] '.$business.'\n'
.'[email] '.$email.'\n\n'
.'[subject] '.$subject.'\n'
.$_POST['message'];
$to = 'support@mysite.com';
$from = 'site@mysite.com'; //Email set up on Gsuite
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= 'From: '.$from;
if (mail($to, $subject, $message, $headers)) {
$location='Location: ./contact-thanks.php';
} else {
$location='Location: ./error';
}
header($location);
die();
?>
MX RECORDS
priority host record points to ttl action
1 @ aspmx.l.google.com 14400 edit delete
5 @ alt1.aspmx.l.google.com 14400 edit delete
5 @ alt2.aspmx.l.google.com 14400 edit delete
10 @ alt3.aspmx.l.google.com 14400 edit delete
10 @ alt4.aspmx.l.google.com 14400 edit delete
BLUEHOST EMAIL CONFIGURATION
Email Settings
Mail Server Username: site@mysite.com
Standard (without SSL)
Incoming Mail Server: mail.mysite.com
Supported Ports: 143 (IMAP), 110 (POP3)
Outgoing Mail Server: mail.mysite.com
Supported Port: 26 (server requires authentication)
Private (with SSL)
Incoming Mail Server: mail.mysite.com
Supported Ports: 993 (IMAP), 995 (POP3)
Outgoing Mail Server: mail.mysite.com (SSL)
Supported Port: 465 (server requires authentication)
Supported Incoming Mail Protocols: POP3, IMAP
Supported Outgoing Mail Protocols: SMTP