phpretard Posted May 6, 2008 Share Posted May 6, 2008 I just want to send an email via PHP that has a link instead of the href content. I've searched the net and found complex information I don't need. I am sure there is a simple way to accomplish this with the right knowledge (that I don't have). Through searching I know it needs to have some type of headers but I don't know which. $to = $Cemail; $email="registration@website.com"; $subject = "Registration"; $body.= "Message from: ".$company; $body.= "\n"; $body.= "\n"; $body.= "You Have Recently Registered With $company"; $body.= "\n"; $body.= "\n"; $body.= "Your Login Information is:"; $body.= "\n"; $body.= "\n"; $body.= "Username: ".$user ; $body.= "\n"; $body.= "Password: ".$pass; $body.= "\n"; $body.= "\n"; $body.="<a href='http://www.website.com?page=secure/main_login&customer=first&myusername=$user&mypassword=$pass>Click Here to login</a>"; mail( $to, $subject, $body, "From: $email"); I would like the link to show up in the email like so: Click Here to login and when you click it actually take you where you need to be. All I can get it to do is deliver this: <a href='http://www.website.com?page=secure/main_login&customer=first&myusername=$user&mypassword=$pass>Click Here to login</a> Thanks for helping. Quote Link to comment Share on other sites More sharing options...
Fadion Posted May 6, 2008 Share Posted May 6, 2008 U need to construct headers, and appart the from and reply to ones, ull need the content-type header. From the php.net mail() examples: // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; $headers .= 'X-MAILER: PHP/' . phpversion(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.