如何从电子邮件发送短信时删除FRM:和MSG:Part

时间:2015-02-09 01:35:18

标签: php email sms phpmailer

我正在尝试向我的手机发送短信,但是当它发送时,它包括FRM:和MSG:

例如

FRM:me@gmail.com
MSG:Hello

我只是想说出来

me@gmail.com
Hello

我怎么能这样做?我正在使用php邮件通过短信网关将其发送到号码。

我的整个代码:

<br>
<br>
<b>Debugging info:</b>
<br>
<?php
$number = trim(strtolower($_GET['number']));
$from = trim(strtolower($_GET['from']));
$message = trim(strtolower($_GET['message']));
$subject = trim(strtolower($_GET['subject']));
$amount = trim(strtolower($_GET['amount']));
$number2 = $number. "@" .$carrier;
print_r($_GET);
require 'PHPMailerAutoload.php';
switch($_GET['carrier']){
    case 'AT&T':
  $carrier = "txt.att.net";
    break;
    case 'Sprint':
  $carrier = "messaging.sprintpcs.com";
    break;
    case 'Verizon':
  $carrier = "vtext.com";
    break;
    case 'T-Mobile':
  $carrier = "tmomail.net";
    break;
    case 'Soufian':
  $carrier = "gin.nl";
    break;
}
$mail = new PHPMailer;
$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'swiftserver.ddns.net';                       // Specify main and backup server
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'server@swiftserver.ddns.net';                   // SMTP username
$mail->Password = 'xxxxxxx';               // SMTP password
$mail->Port = 25591;                                    //Set the SMTP port number - 587 for authenticated TLS
$mail->setFrom('fbi@fbi.gov',$from);     //Set who the message is to be sent fr
$mail->AddAddress($number2);               // Name is optional
$mail->WordWrap = 50;                                 // Set word wrap to 50 characters
$mail->isHTML(true);                                  // Set email format to HTML
$mail->Subject = ''.$subject;
$mail->Body    = ''.$message;
if ($amount > 50){
print("You can only send 50 messages at a time. Change the message number to 50 and refresh the page.");
}
else if($amount < 50){
for($i=0; $i < $amount; $i++)
{
if(!$mail->send()) {
   echo 'Message could not be sent: ';
   echo '' . $mail->ErrorInfo;
   exit;
}
}
echo 'Your message has been sent ' .$amount;
echo ' time(s).';
}
?>
<html>
<br>
<br>
<br>
<br>

0 个答案:

没有答案