PHPMailer到SMS - 删除s:和m:前缀

时间:2016-05-24 20:06:12

标签: php sms phpmailer

我正在使用PHPMailer发送短信。这很有效。然而,消息来自S:和M:在消息的乞讨时。 S:用于主题,M:用于消息。

我已经使用mail()和PHPMailer来发送我的消息。两种方法都包括S和M.

我的代码如下。如何在不显示S和M的情况下使用PHP发送消息?

require('_includes/PHPMailer/PHPMailerAutoload.php');


// Instantiate Class
$mail = new PHPMailer();

// Set up SMTP
$mail->IsSMTP();                // Sets up a SMTP connection
$mail->SMTPDebug  = 2;          // This will print debugging info
$mail->SMTPAuth = true;         // Connection with the SMTP does require authorization
$mail->SMTPSecure = "tls";      // Connect using a TLS connection
$mail->Host = "smtp.sparkpostmail.com";
$mail->Port = 587;
$mail->Encoding = '7bit';       // SMS uses 7-bit encoding

// Authentication
$mail->Username   = "username"; // Login
$mail->Password   = "password"; // Password
$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted

// Compose
$mail->Subject = "";     // Subject (which isn't required)
$mail->Body = "Testing";        // Body of our message

// Send To
$mail->AddAddress( "myphonenumber@email.uscc.net" ); // Where to send it
echo '<pre>';
var_dump( $mail->send() );      // Send!
echo '</pre>';

Example of how messages are formatted on iOS

0 个答案:

没有答案