Ryan Novotny
Ryan Novotny

Reputation: 131

Mailto links in iOS not working

Whenever I try to add a simple mailto link, all devices except iOS work fine.

Based on Apple iPhone Documentation it should work as such:

<a href="mailto:frank@wwdcdemo.example.com">John Frank</a>

But I made a new post on a WordPress site that contains the URL exactly as such and when tapping it on iPhone (iPhone 7 simulator and real iPhone 6) it just gives an error:

enter image description here

Upvotes: 13

Views: 18207

Answers (2)

Josh Buchea
Josh Buchea

Reputation: 1446

Use a real device, not the simulator. Mail and phone apps are not installed on the simulator, so you can't use them.

From Mail Links in the Apple URL Scheme Reference:

iOS Note: If the Mail app is not installed, clicking a mailto URL displays an appropriate warning message to the user.

Upvotes: 19

Zalak Patel
Zalak Patel

Reputation: 1965

You can adding onclick event and get it done:-

<a href="#" onclick="window.location='frank@wwdcdemo.example.com'; return false;" class="noHighlight">John Frank</a>

Hope it helps!

Upvotes: -5

Related Questions