Jump to content

Archived

This topic is now archived and is closed to further replies.

Drezard

Mail() problem

Recommended Posts

Whats wrong with this function?

[CODE]
mail("$email1" "@" "$email2", "Sellyourownhome.com.au activate your account", "Welcome to Sell your own home The easiest and cheapest way to sell your own home" <br> <br> <a href="localhost/activate.php"> <br> <br> "Thanks", "From: Help@sellyourownhome.com.au");
[/CODE]

Cheers, Daniel

Share this post


Link to post
Share on other sites
If you mean the error here it is:

[QUOTE]
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Program Files\xampp\htdocs\newuser.php on line 63
[/QUOTE]

Thanks, Daniel

Share this post


Link to post
Share on other sites
Now the $message part (3rd parameter) wont work. Whats wrong in it?

[CODE]
$to = "$email1@$email2";
$subject = "Sellyourownhome.com.au activate your account";
$message = "Welcome to Sell your own home The easiest and cheapest way to sell your own home <br> <br> <a href="localhost/activate.php"> <br> <br> Thanks";
$headers = "From: Help@sellyourownhome.com.au";
mail($to, $subject, $message, $headers);
[/CODE]

- Cheers, Daniel

Share this post


Link to post
Share on other sites
You must escape double quotes if used within double quotes,

$message = "Welcome to Sell your own home The easiest and cheapest way to sell your own home <br> <br> <a href=[b][color=red]\[/color][/b]"localhost/activate.php[b][color=red]\[/color][/b]"> <br> <br> Thanks";

Share this post


Link to post
Share on other sites
[code]<?php
// email address here
$to= "email@example.com";
// The subject
$subject = "Enter your subject here";
// The message
$message = "Enter your message here";
$from="your_email_here@test.com";
mail($to, $subject, $message, "From: $from");
?>[/code]

  you can do test to ensure data is sent (using if )

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.