Ryan Griggs
Ryan Griggs

Reputation: 2758

PHP how to redirect url to email address and initiate user's mail client

I am writing a URL redirector service in php. Is there a way to use header('location:.....') or other means to redirect from a url to an email address and initiate user's default mail client, in the same way as clicking a mailto:..... link works?

For example, if user enters link http://redirector-service-url.com/xyz123 in the browser, their default mail client would launch with a specified email address associated with this shortcut, in the same way it would launch if they clicked a link?

Would it have to do with the headers returned by the script? I'm sure this could be done with javascript, but I was hoping for a pure php solution...

Thanks!

Upvotes: 2

Views: 4677

Answers (1)

Edward
Edward

Reputation: 1883

header("Location: mailto:[email protected]");

Upvotes: 7

Related Questions