从 Laravel 应用程序向自己发送短信的最佳做法是什么?
What is the best practice to sent a text message to your self from Laravel application?
首先,我不完全确定这是否可能。
我正在尝试通过 短信 .
从我的 laravel 应用程序向我的 phone 发送一条小信息
我想将信息发送到 T-Mobile phone 样本:+19786770001
<?php
$ip = trim(shell_exec("dig +short myip.opendns.com @resolver1.opendns.com"));
$text = Mail::send('emails.site_visit', array('ip' => $ip ) ,
function ($ip) {
$ip->from(env('MAIL_USERNAME') , 'sample gmail');
$ip->to(env('+19786770001') , 'Sample\'s Site ')->subject(' Site Visit Report ' );
});
?>
为了让我看到我的内容,我必须单击 Attachment.html
。
- 我怎么老是看到
Attachement.html
?
- 如何显示短信中的内容而不是 html 文件中的内容?
- 正确的做法是什么?有可能吗?
如有任何提示/建议,我们将不胜感激!
删除主题(因为 SMS 不使用它)并尝试以纯文本形式发送。
Mail::send(['text' => 'emails.site_visit'], array('ip' => $ip ), function ($ip) {
$ip->from(env('MAIL_USERNAME');
$ip->to('<PHONE_NUMBER>@tmomail.net');
});
首先,我不完全确定这是否可能。 我正在尝试通过 短信 .
从我的 laravel 应用程序向我的 phone 发送一条小信息我想将信息发送到 T-Mobile phone 样本:+19786770001
<?php
$ip = trim(shell_exec("dig +short myip.opendns.com @resolver1.opendns.com"));
$text = Mail::send('emails.site_visit', array('ip' => $ip ) ,
function ($ip) {
$ip->from(env('MAIL_USERNAME') , 'sample gmail');
$ip->to(env('+19786770001') , 'Sample\'s Site ')->subject(' Site Visit Report ' );
});
?>
为了让我看到我的内容,我必须单击 Attachment.html
。
- 我怎么老是看到
Attachement.html
? - 如何显示短信中的内容而不是 html 文件中的内容?
- 正确的做法是什么?有可能吗?
如有任何提示/建议,我们将不胜感激!
删除主题(因为 SMS 不使用它)并尝试以纯文本形式发送。
Mail::send(['text' => 'emails.site_visit'], array('ip' => $ip ), function ($ip) {
$ip->from(env('MAIL_USERNAME');
$ip->to('<PHONE_NUMBER>@tmomail.net');
});