PDA

View Full Version : PHP mail function problems!!!


aibrahim
Fri 24th Aug '01, 5:05pm
I have a PHP referral program that emails the message content in a form to a person. Once the email is sent it displays the <a href and </a> tags. I do not want the tags


Here is and example of a run, when I email myself.

//In the Form

Name: Ali
email: alimmail@yahoo.com
message: Hi there check out this poll go vote for it its really cool.

The message posts correctly but I cannot get it to include the website link correctly.

I want the message to include my website name how do I do this correctly

for example this is what happens

Hey whats up hope you get this!!!
This message has been sent to you by Ali
Vote for your opinion at <a href=
"http://www.homepage.com/poll.php"
>the Monthly poll/a>
Poll of the month questionaire:
What do you think of our soccer loss to Ghana?

**** <HTML><A HREF="http://www.homepage.com">Homepage.com<\A></HTML> - where it
happens first ****

This is not what I want, I do not want the <A href tags to appear I just want the link to appear as Homepage.com

Here is the code:


$link_tag = "http://www.homepage.com/poll.php";

$message .= "\n";

$message .= "This message has been sent to you by $name\n";

$message .= "Vote for your opinion at <a href= \"$link_tag\" >www.Homepage.com/poll.php</a>\n";

$message .= "Poll of the month questionaire:\n";

$message .= "$question\n";

$message .= "\n\n\n";

$message .= "**** <HTML><A HREF=\"http://www.Homepage.com\">Homepage.com<\A></HTML> - where it happens first ****";

//here is the mail function
mail($email, "Poll of Opinion Commentary", $message, $headers);



So my final question is how do I implement this line


$message .= "**** <HTML><A HREF=\"http://www.Homepage.com\">Homepage.com<\A></HTML> - where it happens first ****";


to correctly display this in the email message:

***** Homepage.com - where it happens first ****

Mark Hensler
Fri 24th Aug '01, 11:10pm
is this what you want?

$message .= "**** Homepage.com - where it happens first ****";

Chexbox
Sat 25th Aug '01, 3:07pm
what does .= mean in PHP?

s.molinari
Sat 25th Aug '01, 3:14pm
Should it be a link or not. If you want it to be a link but do not want the www. or http:// then you'll need to send the email as HTML.

Try something like this:


$link_tag = "http://www.homepage.com/poll.php";

$message .= "<html><body>";

$message .= "This message has been sent to you by $name<br>";

$message .= "Vote for your opinion at <a href= \"$link_tag\" >Poll of the Month</a><br>";

$message .= "Poll of the month questionaire:<br>";

$message .= "$question<br>";

$message .= "<br><br><br>";

$message .= "**** <A HREF=\"http://www.Homepage.com\">Homepage.com<A> -
where it happens first ****\n</body></html>";

$headers = "Content-Type: text/html; charset=iso-8859-1\n";

mail("$address","Test mail() Function",$message,$headers);

Just a shot in the dark!;)

Scott

Gellpak
Sat 25th Aug '01, 4:30pm
Originally posted by Chexbox
what does .= mean in PHP?

it adds to a variable

ex:

$foo = "12345";

if you echo that, it would be "12345"

but if you do this:

$foo = "12345";
$foo .= "67890";

then it echoes "1234567890"

it can also be done in a single line, like this:

$foo = "12345" . "67890";

Mark Hensler
Sat 25th Aug '01, 5:01pm
I would say 'append'.

Gellpak
Sat 25th Aug '01, 5:55pm
true, i am daunted by your superior implementation of our english language

Mark Hensler
Sat 25th Aug '01, 8:20pm
Originally posted by Gellpak
true, i am daunted by your superior implementation of our english language
imple- what? got a smaller word for me? =P

Chexbox
Sat 25th Aug '01, 8:56pm
I've seen these two words almost everywhere: foo and bar. Is there a specific meaning behind them?

Gellpak
Sat 25th Aug '01, 11:49pm
just php/programming ... i guess history words
kinda like "hello world!"

Chexbox
Sun 26th Aug '01, 12:09am
So there isn't any meaning behind them?

Mark Hensler
Sun 26th Aug '01, 2:51am
Foo (http://www.dictionary.com/cgi-bin/dict.pl?term=foo):
<jargon> /foo/ A sample name for absolutely anything, especially programs and files

Bar (http://www.dictionary.com/cgi-bin/dict.pl?term=bar):
<programming, convention> /bar/ The second metasyntactic variable, after foo and before baz. E.g. "Suppose function FOO calls functions BAR..."

Many people have no idea what they mean (myself included). They are not terms used in every day language. They are just used in code as example variable names or strings or whatnot.

Gellpak
Sun 26th Aug '01, 3:24pm
just kinda 'cult words', from what ive gathered

s.molinari
Sun 26th Aug '01, 3:39pm
FOOBAR and SNAFU are acronyms often used and I believe invented in the U.S. military (army).

FOOBAR is actually spelled FUBAR which means f****d up beyond all repair/recognition.

SNAFU means situation normal: all f****d up.


And now you know the rest of the story.:D


Scott

Gellpak
Sun 26th Aug '01, 4:13pm
hehe, i'll be usin that one a lot now... :p

Mark Hensler
Mon 27th Aug '01, 2:05am
Were you in the military, s.molinari?

s.molinari
Mon 27th Aug '01, 8:18am
Yep, Air Force. :)

aibrahim
Mon 27th Aug '01, 4:02pm
Thank You all for your help.

S. Molinari, thank you this line of code below enabled the use of html and so it worked. Thank you again.

Nice car by the way, do you own one.


$headers = "Content-Type: text/html; charset=iso-8859-1\n";