send email or sms -> send-from should just be a number -> no @ no .com

Discussion in 'PHP' started by martinvidic, Sep 25, 2012.

  1. #1
    Hi there.

    I am sending SMS-messages to different canadian gateways and want the "sender" to be a number only.
    But my server automatically adds @vps0432.domain.com.
    Does anybody know how i can prevent this from happening?

    These are my last 2 lines of code:

    $sender = "403123132123";
    $extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
    Code (markup):
    Thanx
    m.
     
    martinvidic, Sep 25, 2012 IP
  2. dujmovicv

    dujmovicv Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    4
    Trophy Points:
    48
    #2
    Try
    
    $extra = 'From: '.$sender.' <'.$sender.'>'. "\r\n";
    
    Code (markup):
    however, I believe it depends on the server configuration also... You can also check the line with sendmail_path in your php.ini to see how it is configured...
     
    dujmovicv, Sep 26, 2012 IP
  3. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #3
    I suggest using a dedicated SMS gateway like Clickatell
     
    crivion, Sep 26, 2012 IP