1.11M Members

To create url link inside an email body

 
1
 

How can I create links inside an email content? can you send me a code for that?

 
0
 

do you mean as in sending an email with php with a link in the email?

 
0
 

do you mean as in sending an email with php with a link in the email?

exactly, such as the person who got the email would want to give a feedback and he would click the link feedback and a new PHP page would open..

 
0
 

are you sending an html email or a text email?

 
0
 

are you sending an html email or a text email?

I am trying to write the code of sending an email with PHP, and inside the body of the mail I want to create a link..Please if you can help me..

 
0
 

Try this:

This code is for an HTML Email

<?php
$our_email = "youremail@something.com";
$to = "someone@something.com";
$from = $our_email;
$subject = "yoursubject";
$message = <<<EOF
<html>
<body>
<a href="http://www.yourlink.com">Click Here!!!</a>
</body>
</html>
EOF;
$headers  = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$mail = mail($to, $subject, $message, $headers);
}
if ($mail) {
echo "Message sent successfully";
}
else {
echo "Message didn't send";
}
?>

This code is for a txt email

<?php
$our_email = "youremail@something.com";
$to = "someone@something.com";
$from = $our_email;
$subject = "yoursubject";
$message = "www.somelink.com";
$mail = mail($to, $subject, $message, "From: $our_email");
if ($mail) {
echo "Mail Sent";
}
else {
echo "Error - Mail Not Sent";
}
?>
 
0
 

Can I use html to create a hyperlinked url in the body of an email?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article