Jump to content


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


need help formatting link in php

Recommended Posts

I have set up an autoresponder. In the autorespond message, I'd like to add a link, either to another page or to a mailto: link so we know they received the email.

Below is the code I have for the message. Can someone tell me what I'm doing wrong?

////// Now we are ready to send the email so we call php's mail() function
//////with the appropriate variables from above included in the brackets
////// Auto-Responder
////// You can substitute any of form fields in response by using
////// %field_name% in response text.
$autoresponder_enabled = 1;
$autoresponder_from = $send_to;
$autoresponder_subject = $subject;
$autoresponder_message = <<<MSG
Hi %nominatorName_req%,\n
Thank you for your nomination. \n
Please recheck your submitted information and reply to this message to complete the nomination process for the 2007-2010 Nominations.\n
----------Nominee Information------------\n
Nominee Name: %nomineeName_req%\n
Nominee Institution: %nomineeInstitution_req%\n
Nominee Department: %nomineeDept_req%\n
Nominee Field of Study: %nomineeField_req%\n
If Other: %nomineeOtherField%\n
Nominee Date of PhD: %nomineePhd_req%\n
Nominee Address: %nomineeAddress_req%\n
Nominee Phone: %nomineePhone_req%\n
Nominee Email: %nomineeEmail_req%\n
----------Nominator Information----------\n
Nominator Name: %nominatorName_req%\n
Nominee Title: %nominatorTitle_req%\n
Nominator Institution: %nominatorInstitution_req%\n
Nominator Department: %nominatorDept_req%\n
Nominator Address: %nominatorAddress_req%\n
Nominator Phone: %nominatorPhone_req%\n
Nominator Email: %nominatorEmail_req%.\n
***here is where i'd like to put the link. i have deleted anything i tried hoping to not look less dumb***

Share this post

Link to post
Share on other sites
I may be incorrect on this one (someone please correct me if so) but I think your email must be HTML formatted, rather than plain text... Though plain text hyperlinking does exist, it relys on the mail client to automatically parse the URL as a link.

Share this post

Link to post
Share on other sites
It's as simple as adding in an HTML link to whatever page you want them to click on, but remember that they must click on it or you have to run some JavaScript that will make a call to your site. But most mail clients block JavaScript so you're stuck with making them click a link, and experience tells me that most people will ignore it.

And xyph is correct... you need to use headers to set the email to HTML output to have the hyperlink work. (Read the mail() entry in the manual to find out how to set that up).

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.