简体   繁体   English

Laravel添加?发邮件

[英]Laravel Adding ? to E-mail

Using Laravel 4 to send an email to a mobile phone email address and it adds a ? 使用Laravel 4向手机电子邮件地址发送电子邮件并添加一个? to the beginning of the message. 到消息的开头。 Sending as html or text makes no difference. 发送为HTML或文本没有区别。 I've tested using native PHP mail function as well as CodeIgniter's mail function to the same mobile email address and there is NO question mark. 我已使用本机PHP邮件功能以及CodeIgniter的邮件功能测试到同一个移动电子邮件地址,并且没有问号。 This is only happening when sending to a mobile email. 这仅在发送到移动电子邮件时发生。 Any suggestions? 有什么建议?

public function send(){
        $data['name']= 'Jane';
        Mail::send(array('text' => 'textmessages.reminder'), $data, function($message){
            $message->from('me@myemail.com', 'Me');
            $message->to('1231231212@yourmobileemail.com')->subject('Test');
        });
    }

and the entire view: 和整个观点:

Hi <?=$name?>

The text message reads: 短信内容如下:

(Test) ?Hi Jane (测试)?嗨简

When view file was created, it was set to "Include Unicode Signature (BOM)" which was causing the problem (but only when sent to a mobile email address). 创建视图文件时,它被设置为“包含Unicode签名(BOM)”,这导致了问题(但仅在发送到移动电子邮件地址时)。 Creating a new view file without this option checked solved the problem. 未选中此选项创建新视图文件可解决此问题。 No more question mark. 没有问号了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM