6G Celicas Forums

Welcome Guest ( Log In | Register )

> php sms message sending script, help please, need to change the from address
post Jul 29, 2007 - 6:08 PM
+Quote Post
maxaud

Enthusiast
*
Joined Aug 16, '06
From Sandpoint, Idaho
Currently Offline

Reputation: 0 (0%)




I'm piecing together a script to send text messages from one of my sites to my cell phone. I got it all work'd out all fine and It sends the message fine but the 'from address' is defined as anonymous@myserver.com when I'd like to have it as either...

1) I'd prefer to have it as the email address that the person fills out on the form that texts me

OR

2)nobody@mydomain.com

the current script is..

CODE
<?php

$to="##########@vtext.com, myemail@mydomain.com";

$sucessURL="http://www.mydomain.com/success";

$failureURL="http://www.mydomain.com/error";

$subject="sitetxt";

$msg = "Name: {$_POST['txtName']}\nPhone: {$_POST['txtNumber']}\nEmail: {$_POST['txtEmail']}\nMessage: ".nl2br($_POST['txtMessage'])."
";

$headers  = "From: {$_POST['txtEmail']}";

if(mail($to, $subject, $msg, $headers))
{
    header("Location: $sucessURL");
}
else
{
    header("Location: $failureURL");
}
?>


--------------------
▲my $.02 --Dustin
₪₪₪₪₪₪₪₪₪₪₪₪₪
IPB Image
 
Start new topic
Replies
post Jul 31, 2007 - 1:45 PM
+Quote Post
maxaud

Enthusiast
*
Joined Aug 16, '06
From Sandpoint, Idaho
Currently Offline

Reputation: 0 (0%)




small update. I got it to work correctly when sent to a regular email address (not a cell phones address), but it still shows up as anonymous@myserver.com in the sms message


--------------------
▲my $.02 --Dustin
₪₪₪₪₪₪₪₪₪₪₪₪₪
IPB Image

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: July 26th, 2025 - 1:01 PM