Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2011
    Posts
    122
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Using mail() to send text, but there's two forward slashes in message?

    When I receive the message, there are two forward slashes I suppose between the subject and the 'from' part, is there any way to somehow remove that? Thanks. Here's my code:

    PHP Code:
    if(isset($_REQUEST["send"]))
    {
        
    $to1 $_REQUEST["tomail"];
        
    $to str_replace(array("\r""\n""%0a""%0d"), ''stripslashes($to1));
        
    $carrier $_REQUEST["carrier"];
        
    $amount $_REQUEST["amount"];
        
    $message stripslashes($_REQUEST["msg"]);
        
    $msg wordwrap($message70);
        
    $header  "MIME-Version: 1.0" "\n";
        
    $header .= "Content-type: text/html; charset=iso-8859-1" "\n";
        
    $header .= "from:$from";
        
    $i 1;
        
        if(
    $carrier == "T-Mobile") {
        
    $victim "1".$to."@tmomail.net";
        }elseif(
    $carrier == "Verizon") {
        
    $victim "1".$to."@vtext.com";
        }elseif(
    $carrier == "AT&T") {
        
    $victim "1".$to."@txt.att.net";
        }elseif(
    $carrier == "Sprint") {
        
    $victim "1".$to."@messaging.sprintpcs.com";
        }elseif(
    $carrier == "Boost Mobile") {
        
    $victim "1".$to."@myboostmobile.com";
        }elseif(
    $carrier == "Tracfone") {
        
    $victim "1".$to."@mmst5.tracfone.com";
        }elseif(
    $carrier == "U.S. Cellular") {
        
    $victim "1".$to."@email.uscc.net";
        }
        
        while(
    $i <= $amount)
        {
            
    mail($victim,'',$msg,'From: TextPirate' '\r\n');
            
    $sent "yes";
            
    $i++;
        }

    Code:
    <!-- mail form -->
    <div class="well">
    
        <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        <div class="carrier">
        <div class="control-group" style="float:left;">
      		<label class="control-label" for="inputIcon">Arrgh! What be the victim's number?</label>
      			<div class="controls">
        		<div class="input-prepend">
          			<span class="add-on"><i class="icon-signal"></i></span>
          			<input id="inputIcon" name="tomail"  style="width: 450px;" placeholder="US numbers only, no need to include '1,' spaces, or hyphens." type="text">
        		</div>
      			</div>
    	</div>
    	
        <div class="control-group" style="float:left; padding-left: 10px;">
      		<label class="control-label" for="inputIcon">Choose carrier:</label>
      			<div class="controls">
        		<div class="input">
     		 			<select style="width: 150px;" name="carrier">
     		 				<option name="sprnt"><a>Sprint</a></option>
     		 				<option name="att"><a>AT&T</a></option>
     		 				<option name="vzw"><a>Verizon</a></option>
      		 				<option name="tmo"><a>T-Mobile</a></option>
      		 				<option name="bst"><a>Boost Mobile</a></option>
      		 				<option name="tnf"><a>Tracfone</a></option>
      		 				<option name="usc"><a>U.S. Cellular</a></option>
      					</select>
        		</div>
      			</div>
    	</div>
    	</div>
    	
        <div class="control-group">
      		<label class="control-label" for="inputIcon">How many shall we send the lad?</label>
      			<div class="controls">
        		<div class="input-prepend">
          			<span class="add-on"><i class="icon-inbox"></i></span>
          			<input id="inputIcon" name="amount" placeholder="<?php if($user != 1){?> We only allow guests to send a maximum of 100 per 24 hours. <?php }elseif($user == 1){?>Maximum: 1000 <?php } ?>" type="text">
        		</div>
      			</div>
    	</div>
    	
        <div class="control-group">
    		<label class="control-label" for="inputIcon">Now what shall we say to the Ol' Scalleywag?</label>
     			 <div class="controls">
      			 <div class="input">
          			<textarea name="msg" style="height: 200px;" placeholder="We don't mind if you include our website! Hint, hint."></textarea>
        		</div>
      			</div>
    	</div>
    	
        <p style="text-align: center;"><button class="btn btn-large btn-primary" type="submit" name="send" type="button"><i class="icon-envelope"></i> Send ye' texts!</button></p>
        </form>
        
    </div>
    <!-- mail form -->

  • #2
    Junsee
    Guest
    please show us what the message looks like?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •