Jump to content

need help formatting link in php


kimeee

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***
MSG;
Link to comment
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.
Link to comment
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).
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.