I think this is either my first or second post on here, but at any rate I'm pretty new to PHP, so I really need some help.
I'm creating a script that automatically sends an email to a person when I create an account for them on my service (it's a closed service that's invite-only). I want to send them a mail asking the user to click on a link to verify their account.
In order to send the mail, I used heredoc formatting, like so:
Code: Select all
$mail_body=<<<MAIL
To $first_name $last_name:
I have created an account for you on my service. Please click on the following link to activate it and choose a password:
$validation_url?email=$safe_email&validation_string=$validation_string
Please note that you will be unable to access your account until you complete the validation process.
Sincerely,
The staff at NFG Co, Ltd.
MAIL;What's also stranger is that, just for kicks and giggles, I decided to paste the following code into my script to see what would happen:
Code: Select all
class foo
{
var $foo;
var $bar;
function foo()
{
$this->foo = 'Foo';
$this->bar = array('Bar1', 'Bar2', 'Bar3');
}
}
$foo = new foo();
$name = 'MyName';
$message_body = <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should print a capital 'A': \x41
EOT;
mail($email,$subject,$message_body);
?>
Regards,
Blain Armstrong.
Toride, Japan