发送注册电子邮件时出现问题?

时间:2020-04-15 01:56:14

标签: php email

发送用户的激活电子邮件时出现问题。我有Mailer.php文件,其中是注册后发送的代码,这是代码:

<?php

#################################################################################
##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 ##
## --------------------------------------------------------------------------- ##
##  Filename       Mailer.php                                                  ##
##  Developed by:  Dixie                                                       ##
##  License:       TravianX Project                                            ##
##  Copyright:     TravianX (c) 2010-2011. All rights reserved.                ##
##                                                                             ##
#################################################################################

class Mailer {

    function sendActivate($email,$username,$pass,$act) {

        $subject = "Welcome to ".SERVER_NAME;

        $message = "Hello ".$username."

Thank you for your registration.

----------------------------
Name: ".$username."
Password: ".$pass."
Activation code: ".$act."
----------------------------

Click the following link in order to activate your account:
http:www.travianforce.com.es/activate.php?code=".$act."

Greetings, And dont forget invite all your friends to play on travianforce! =)
TRAVIANFORCE GAMES";

        $headers = "From: support@travianforce.com.es".SERVER_NAME."\n";

        mail($email, $subject, $message, $headers);
    }

    function sendInvite($email,$uid,$text) {

        $subject = "".SERVER_NAME." registeration";

        $message = "Hello ".$username."

Try the new ".SERVER_NAME."!


Link: http://www.travianforce.com.es/anmelden.php?id=ref".$uid."

".$text."


Greetings, And dont forget invite all your friends to play on travianforce! =)
TRAVIANFORCE GAMES";

        $headers = "From: support@travianforce.com.es".SERVER_NAME."\n";

        mail($email, $subject, $message, $headers);
    }

    function sendPassword($email,$uid,$username,$npw,$cpw) {

        $subject = "Password forgotten";

        $message = "Hello ".$username."

You have requested a new password for Travian.

----------------------------
Name: ".$username."
Password: ".$npw."
----------------------------

Please click this link to activate your new password. The old password then
becomes invalid:

http://www.travianforce.com.es/password.php?cpw=$cpw&npw=$uid

If you want to change your new password, you can enter a new one in your profile
on tab \"account\".

In case you did not request a new password you may ignore this email.

TRAVIANFORCE GAMES
";

        $headers = "From: support@travianforce.com.es".SERVER_NAME."\n";

        mail($email, $subject, $message, $headers);
    }

};
$mailer = new Mailer;
?>

但是,当用户注册时,他没有发送消息,并且在Horde网络邮件中显示了以下错误:

此消息是由邮件传递软件自动创建的。 您发送的邮件无法传递到其一个或多个 收件人。这是一个永久性错误。以下地址失败: gadprofecy@gmail.com 主机gmail-smtp-in.l.google.com [172.217.204.27] 数据结束后来自远程邮件服务器的SMTP错误: 550-5.7.1 [184.171.251.122 13]在“发件人”中具有多个地址的邮件: 550 5.7.1标头不被接受。 m68si1348713vsc.19-gsmtp

我还有文件mailme.php,其中声明了电子邮件的参数,代码是这样的:

<?php

if ($_POST && count($_POST)) {

    include_once('GameEngine/config.php');

    $strEmpfaenger = (ADMIN_EMAIL ? ADMIN_EMAIL : (PAYPAL_EMAIL ? PAYPAL_EMAIL : 'support@travianforce.com.es'));

    $strFrom       = "From: TRAVIANFORCE X150 <$strEmpfaenger>\n";
    $strSubject    = "New Ticket supported";
    $strReturnhtml = 'dorf1.php';
    $strDelimiter  = ":\t";
    $strMailtext   = "";

    while (list($strName, $value) = each($_POST)) {
        if (is_array($value)) {
            foreach ($value as $value_array) {
                $strMailtext .= $strName . $strDelimiter . $value_array . "\n";
            }
        } else {
            $strMailtext .= $strName . $strDelimiter . $value . "\n";
        }
    }

    if (get_magic_quotes_gpc()) {
        $strMailtext = stripslashes($strMailtext);
    }

    mail($strEmpfaenger, $strSubject, $strMailtext, $strFrom) or die("The mail could not be send. Something get wrong!");

    header("Location: $strReturnhtml");

    exit;
}
?>

为什么向我显示未发送消息的错误?

0 个答案:

没有答案