I want to open an email from a link that is the persons email address, which is displayed in a table with their personal information.
I can ‘kind of’ get it to work doing this;
<a href="mailto:<?php $person['Person']['primEmail']; ?>"><?php echo $person['Person']['primEmail']; ?></a>
The new email opens using the default mail client, however the email address is not populated in the ‘To:’ field, which is really what I am after.
The code you have produces the following:
Which causes the behavior you’re experiencing because the
hrefattribute isn’t pointing to an actual email address. This is due to the missingprintorechoin thehrefattribute. Your code should look like this, instead:Which will produce:
And will work as intended.