0

trying to make a href link that will open a premade email with subject and body prefilled. the parameters are taken using php

the code below works in taking user email and writing the subject, but the body is also written in the subject line instead of the email body

how would i separate them?

<a href="mailto:<?php echo $v['email']; ?> ?subject=<?php echo "subject 
here"; ?> ?body=<?php echo "your email is approved"; ?>"><i class="icon- 
envelope"></i></a>
myo
  • 19
  • 4

1 Answers1

1

You have to use & rather than ? after the first usage. Like this:

<a href="mailto:<?php echo $v['email']; ?>?subject=<?php echo 'subject here'; ?>&body=<?php echo 'your email is approved'; ?>"><i class="icon-envelope"></i></a>
  • 1
    This isn't really worth an answer, it should just be closed as a typo after the comments that say this. – Barmar Jan 15 '19 at 17:02