Email to SMS Script

Discussion in 'PHP' started by SMSHeat01, Oct 6, 2007.

  1. #1
    i have a very simple php email 2 sms script that can send email to mobile i.e sms. Problem is that when some one gets the mail, he got the email address of my hosting company i.e root@2444.myhosting.com
    I do not like. I want receiver get my own site mailing address.e.g sms@mywebsite.com

    What Code should i put in php script to make as stated above. If any one know please tell me here
    If you want my script to understand more (If you can), post here, i will PM you the script

    Thankyou!
     
    SMSHeat01, Oct 6, 2007 IP
    Gnoc likes this.
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Try setting this above the code that sends the mail.
    
    ini_set('sendmail_from', 'sms@mywebsite.com');
    
    PHP:
    If that doesn't work, post your actual code.
     
    nico_swd, Oct 6, 2007 IP
  3. SMSHeat01

    SMSHeat01 Peon

    Messages:
    163
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    it seems that this does not work. I am Sending you the Code via PM. Please check & PM me it back with setting as stated above.
     
    SMSHeat01, Oct 6, 2007 IP
  4. Squash

    Squash Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You must send headers in this case. You must use following code

    
    $to        = 'somebody@domain.com';
    $subject = 'Mail Subject';
    $message = 'This is the text of message';
    $headers = 'From: youremail@yourdmain.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    
    mail($to, $subject, $message, $headers);
    
    PHP:
     
    Squash, Oct 6, 2007 IP
  5. SGTScripts

    SGTScripts Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    like squash mentioned you need to set your headers..you dont even have to put the right info.. you can put like


    lol
     
    SGTScripts, Oct 6, 2007 IP