HTML Mailto with PHP Variables

Hi :slight_smile:

I am needing to have a html mailto hyperlink to be made up of PHP variables, here is what I have so far but all it does it puts in the plain text into the email message
[php]header(‘Location: mailto:<?php echo $email?>?subject=<?php echo $subject?>’);
[/php]
What can I do to achieve this?

Thanks in advance :slight_smile:

Hi there,

Use the following code and it should work.

[php]<?php header("Location: mailto:$email?subject=$subject"); ?>[/php]

Encapsulate the whole command in PHP and use the double-quotes to echo out the variables. I tested it and it works. If this isn’t what you were looking for just tell me and I’ll give you something else.

L-e-d-g-e-n-d.

Thank you very much :slight_smile:

No problem. Glad to have helped. :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service