如何在Azure Web应用上发送PHP邮件功能? [英] How to send PHP mail function on Azure web app?

查看:86
本文介绍了如何在Azure Web应用上发送PHP邮件功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用PHP邮件功能将HTML表单发送到我的邮件. 当我运行代码时,没有错误发生,但是我没有收到电子邮件. 我使用了以下代码:

I want to use the PHP mail function to send a HTML form to my mail. When I run the code it no error occurs, but I don't receive an email. I used the following code:

<?php
$to      = 'email@email.com';
$subject = 'Subject';
$message = 'Message here';
$headers = 'From: email@email.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 

我正在使用PHP 7.0在Microsoft Azure上托管我的Web应用程序.

I'm hosting my web app on Microsoft Azure with PHP 7.0.

推荐答案

我假设Microsoft关闭了PHP邮件. (许多托管服务提供商这样做)

I assume Microsoft turned PHP mail off. (many hosting providers do)

Microsoft表示您应该使用SendGrid.您可以在此处阅读完整的教程:

Microsoft says that you should use SendGrid. You can read the full tutorial here: https://azure.microsoft.com/en-us/documentation/articles/store-sendgrid-php-how-to-send-email/

这篇关于如何在Azure Web应用上发送PHP邮件功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆