incoming-mail 相关问题


在 Laravel 7.x 中如何识别邮件是否是使用 Mail::send() 或 Mail::queue() 触发的

我在 Laravel7.x 中有如下代码 Mail::queue(new ReportMail($user)); Mail::send(new ReportMail($user)); 在 ReportMail 类中,有一种方法可以知道邮件是否被调用 邮件::森...


在 iPhone 中打开时,“城市”被检测为电子邮件中的关键字

我已经创建了用 PHP 发送邮件的 API。下面是我的代码 $content = $content."地址: ".$fromUser["address"]; $内容 = $内容。” 我已经创建了 API 来用 PHP 发送邮件。下面是我的代码 $content = $content."<br/><b>Address : </b>".$fromUser["address"]; $content = $content."<br/><b>City : </b>".$fromUser["city"]; $to = '[email protected]'; include('PhpMailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = TRUE; $mail->SMTPSecure = "ssl"; $mail->Host = "smtp.gmail.com"; $mail->Port = 465; $mail->Username = "####"; $mail->Password = "####"; $mail->setFrom("[email protected]","abc"); $mail->isHTML(true); $mail->AddAddress($to); $mail->Subject = 'Test'; $mail->MsgHTML($content); if ($mail->Send()) { return 1; } else { return 0; } 我收到电子邮件,但内容中的关键字“城市”显示超链接。我想删除它。 [注意:如果我写“City1”而不是“City”,则链接将被删除] 您的 $fromUser["address"] 以 标签开头,但变量内没有标签结尾。 一种方法是为输出添加 stript_tags() 。 $content = $content."<br/><b>Address : </b>".strip_tags($fromUser["address"]); $content = $content."<br/><b>City : </b>".strip_tags($fromUser["city"]); 更好的方法是在用数据填充 $fromUser 变量时就剥离标签。


Dispatcher 在使用 spring-integation-mail 时没有订阅者

我们有一个多租户应用程序,它允许用户按需创建 IMAP 邮件获取器(也称为邮件接收器)并单独处理它们。为此,我们决定使用:spring-integration-mail (v ...


表单响应:“无法处理请求 HTTP ERROR 500”。我做错了什么?

我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: 我尝试在网站上编写 php 表单,但收到错误 500。我无法弄清楚我做错了什么。你能看一下代码看看我做错了什么吗? PHP: <?php // define variables and set to empty values $name = $email = $phone = $enquiry = ""; if ( $_SERVER[ "REQUEST_METHOD" ] == "POST" ) { if ( empty( $_POST[ "name" ] ) ) { $nameErr = "Name is required"; } else { $name = test_input( $_POST[ "name" ] ); // check if name only contains letters and whitespace if ( !preg_match( "/^[a-zA-Z-' ]*$/", $name ) ) { $nameErr = "Only letters and white space allowed"; } } if ( empty( $_POST[ "email" ] ) ) { $emailErr = "Email is required"; } else { $email = test_input( $_POST[ "email" ] ); // check if e-mail address is well-formed if ( !filter_var( $email, FILTER_VALIDATE_EMAIL ) ) { $emailErr = "Invalid email format"; } } if ( empty( $_POST[ "phone" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "phone" ] ); } if ( empty( $_POST[ "enquiry" ] ) ) { $comment = ""; } else { $comment = test_input( $_POST[ "enquiry" ] ); } } // Create the email and send the message $destination = "[email protected]"; $subject = "Website Contact Form Enquiry: $name"; $body = "You have received a new message from your website contact form.\\n\\n"."Here are the details:\\n\\nName: $name\\n\\nEmail: $email\\n\\nPhone: $phone\\n\\nEnquiry:\\n$enquiry"; $header = "From: [email protected]\\n"; $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=iso-8859-1"; $headers[] = "From: " . $fromAddress; $headers[] = "Subject: " . $subject; $headers[] = "X-Mailer: PHP/".phpversion(); mail($destination, $subject, $message, implode("\r\n", $headers)); // mail($to,$subject,$msg,$headers); echo "Email successfully sent."; ?> HTML 格式: <form id="contact-form" method="post" action="/contact.php" role="form"> <div class="messages"></div> <div class="controls"> <div class="row"> <div class="col-md-10"> <div class="form-group"> <input id="form_name" type="text" name="name" class="form-control" placeholder="Name*" required="required" data-error="Your name is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_email" type="email" name="email" class="form-control" placeholder="Email*" required="required" data-error="Valid email is required." > <div class="help-block with-errors"></div> </div> </div> <div class="col-md-10"> <div class="form-group"> <input id="form_phone" type="text" name="phone" class="form-control" placeholder="Phone" > <div class="help-block with-errors"></div> </div> </div> </div> <div class="row"> <div class="col-md-10"> <div class="form-group"> <textarea id="form_enquiry" name="enquiry" class="form-control" placeholder="Enquiry*" rows="6" required="required" data-error="Please, leave us a message."></textarea> <div class="help-block with-errors"></div> </div> </div> <div class="col-md-12"> <input class="btn btn-large btn-primary centre mt-10" type="submit" value="Submit" > </div> </div> </div> </form> 我已按照其他人的指示使表单正常工作,但所做的更改仍然会出现错误。 这是一个简单的形式,但我似乎对我做错了什么缺乏了解。 请帮助我。 如果您查看发送邮件的行,这是一个硬行结尾,将 $headers 推到新行上吗?这将调用 500 错误。 查看 /var/log/apache2/error.log(如果您使用的是 Debian)或 /var/log/httpd/error.log(如果使用的是 RHEL 或类似系统)。 您的代码存在许多问题,但首先关注快乐的道路,然后让事情正常运行。


© www.soinside.com 2019 - 2024. All rights reserved.