联系表格7未收到电子邮件

时间:2019-03-05 06:34:07

标签: wordpress email contact-form-7

我正在使用联系表格7,并且遇到此电子邮件ID的问题,但我没有收到任何邮件,我们可以为此做些什么。我也使用SMTP。 你能建议我其他方法吗?

2 个答案:

答案 0 :(得分:0)

您检查了垃圾邮件文件夹吗?也许电子邮件中有垃圾邮件,而电子邮件中没有垃圾邮件,您可以使用https://wordpress.org/plugins/wp-mail-smtp/

这里是设置文档https://wpforms.com/docs/how-to-set-up-smtp-using-the-wp-mail-smtp-plugin/

请检查可能对您有帮助。

答案 1 :(得分:0)

最好的选择是在php中使用PhpMailer库。您可以检查电子邮件是否使用php mailer成功发送。您需要做的就是获取所有库代码并将其添加到FTP或使用composer安装。

  

这是一个简单的例子。

<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

// Load Composer's autoloader
require 'vendor/autoload.php';

// Instantiation and passing `true` enables exceptions
$mail = new PHPMailer(true);

try {
    //Server settings
    $mail->SMTPDebug = 2;                                       // Enable verbose debug output
    $mail->isSMTP();                                            // Set mailer to use SMTP
    $mail->Host       = 'smtp1.example.com;smtp2.example.com';  // Specify main and backup SMTP servers
    $mail->SMTPAuth   = true;                                   // Enable SMTP authentication
    $mail->Username   = 'user@example.com';                     // SMTP username
    $mail->Password   = 'secret';                               // SMTP password
    $mail->SMTPSecure = 'tls';                                  // Enable TLS encryption, `ssl` also accepted
    $mail->Port       = 587;                                    // TCP port to connect to

    //Recipients
    $mail->setFrom('from@example.com', 'Mailer');
    $mail->addAddress('joe@example.net', 'Joe User');     // Add a recipient
    $mail->addAddress('ellen@example.com');               // Name is optional
    $mail->addReplyTo('info@example.com', 'Information');
    $mail->addCC('cc@example.com');
    $mail->addBCC('bcc@example.com');

    // Attachments
    $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
    $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name

    // Content
    $mail->isHTML(true);                                  // Set email format to HTML
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
    echo 'Message has been sent';
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
  

您可以在Php Mailer On Github

上获取有关PhpMailer的所有信息。

PhpMailer的配置正确,因此您不必担心电子邮件最终位于“垃圾邮件”文件夹中。另外,请注意您定期发送给单个收件人的邮件数量。