Jump to content


need help formatting link in php

  • Please log in to reply
2 replies to this topic

#1 kimeee

  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 07 June 2006 - 07:35 PM

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***

#2 xyph

  • Staff Alumni
  • Advanced Member
  • 3,712 posts
  • LocationSurrey, BC

Posted 07 June 2006 - 07:39 PM

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.
Everything you need to know about storing user-names and passwords
Blank Page? Try forcing errors to display

#3 ober

  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 07 June 2006 - 07:40 PM

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).

Info: PHP Manual

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users