English 中文(简体)
• 如何在窗户发出使用PHP的电子邮件?
原标题:How can i send an Email using PHP at windows Azure?
  • 时间:2012-05-14 11:32:19
  •  标签:
  • php
  • azure

• 如何在窗户发出使用PHP的电子邮件?

i 使用简单的邮件功能:

$to .=  email-Id ;
$subject = " Test Subject";

$headers  =  MIME-Version: 1.0  . "
";
$headers .=  Content-type: text/html; charset=iso-8859-1  . "
";
$headers .=  To:  .$to.   . "
";
$headers .=  From:  .$name.  < .$email. >  . "
";

echo $message= email text here ;
@mail($to, $subject, $message, $headers);
最佳回答

寄送使用PHP的电子邮件:

http://www.ohchr.org。

页: 1 员工和管理当局协调会服务器可以使用。 员工和管理当局协调会的服务器目前不属于“Windows”的功能。

[mail function]
SMTP = mail.mycompany.com

<><0>Option 2: Use sentmail

页: 1

[mail function]
sendmail_path = "C:wampsendmailsendmail.exe -t"

由于发送电子邮件在Windows上确实存在,因此,你需要使用fake sentmail forvils:

<>可见>第3版:使用邮件/邮件服务

您可使用SendGrid等服务发送您的电子邮件(用户有:)。 他们负责寄送电子邮件,你只需要打电话给教育、科学和技术部。

$sendgrid = new SendGrid( username ,  password );
$mail = new SendGridMail();
$mail->addTo( [email protected] )->
       setFrom( [email protected] )->
       setSubject( Subject goes here )->
       setText( Hello World! )->
       setHtml( <strong>Hello World!</strong> );
$sendgrid->smtp->send($mail);
问题回答

I had never done PHP, but the following guide was step by step and incredibly easy to get working.

http://www.windowsazure.com/en-us/Documentation/Articles/store-sendgrid-php-how-to-send-email/

希望能帮助他人。

email-Id ?? what is this? I m guessing it is the email address of the recipient.

Your headers do not require the To: as the to address is specified in the first parameter. Unless you know the recipient s name and want him to see email was sent to: Some Name not just you do not need that. Also you have an error in it: missing <> before and after the email address.

P.S. Emails sent through PHP s mail() function have one of the highest rates of ending up in SPAM, especially if you do not have Domain Keys and SPF set in your DNS for this. If using Cpanel please refer to Email Authentication section of your Email group in Cpanel.

I was having the same trouble , but this solution works perfectly for me . just follow these steps :

  1. Just enable 2 step verification on your G-mail account.
  2. Go to app password and then select app = other and then type AzureWebsite and generate a password , and keep the password.
  3. replace the

电子邮件->Password = 新的密码;

4. 第四条第4款 我希望这也将有利于你。

最新资料 @ Nov-2017:

Full Blog post: https://blogs.msdn.microsoft.com/mast/2017/11/15/enhanced-azure-security-for-sending-emails-november-2017-update/

Recommended Method of Sending E-mail

“Microsoft recommendation 客户使用经认证的员工和管理当局协调会转发服务(通常通过TCP港587或443连接,但往往支持其他港口)。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签