2

Is it possible to put a link or any downloadable contents under $autoreply in my php (click HERE part)?

I hardly found any answers online and I think I'm still lack of understanding of coding php.

<?php

/* SETTING VARIABLES */

/* FORMFIELD 1 */
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$nickname = $_POST['nickname'];
$age = $_POST['age'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$skype = $_POST['skype'];

/* FORMFIELD 2 */
$membership = implode(',', $_POST['membership']);
$memberdetail = $_POST['memberdetail'];

/* RESPONSE TO Eng2Skype's email */

$autoreply="Thank you for registering with English2Skype™ \n\nPlease click HERE to download our manual and application forms \n\n English2Skype™ team";
$subject="Thank you for your submission! - English2Skype";

mail($email, $subject, $autoreply);

/* INFORMATION TO BE EMAILED */

$formcontent = "Name: $name \n Lastname: $lastname \n Nickname: $nickname \n Age: $age \n Phone: $phone \n Email: $email \n Skype: $skype \n Membership: $membership \n Member Detail: $memberdetail";

$recipient = "englishtoskype@gmail.com";
$subject = "Eng2Skype Online Register";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

/* RESPONSE TO Eng2Skype's email */

echo '<img src="../images/subpages/eng2skype.png">';
echo "<br>";
echo "<br>";
echo "Thank you for registering with English2Skype program. Please check your email for downloadable manual and application forms.";

echo "<br>";
echo "<br>";
echo "<a href='../index.php' style='text-decoration:none; color:#df2590;'> Return Home</a>";

echo "<br>";
echo "<br>";
echo "Love us, Follow us at";
echo '<img src="../images/subpages/eng2skype-poster.png" width="200" height="200" />';
?>
James Z
  • 12,209
  • 10
  • 24
  • 44
T.Green
  • 23
  • 2
  • You can write html code in your email message. For an attachment please view this page: https://stackoverflow.com/questions/12301358/send-attachments-with-php-mail – Lithilion Mar 04 '18 at 06:58
  • 1
    Possible duplicate of [Send attachments with PHP Mail()?](https://stackoverflow.com/questions/12301358/send-attachments-with-php-mail) – mickmackusa Mar 04 '18 at 08:19

1 Answers1

0

You just can write a html email. You need to set headers and just add a link to HERE.

$mailheader = 'MIME-Version: 1.0'."\r\n";
$mailheader .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
$mailheader .= 'From: '.$email." \r\n";


$autoreply="Thank you for registering with English2Skype™ \n\nPlease click <a href='http://your.download.link'>HERE</a> to download our manual and application forms \n\n English2Skype™ team";

https://secure.php.net/manual/en/function.mail.php

Lithilion
  • 1,097
  • 2
  • 11
  • 26
  • It works! I had no idea about the headers though. It seems I have so much to learn. Thank you, thank you, thank you! – T.Green Mar 04 '18 at 09:35