Send email from an iphone application?

Hi there. I would like to send an email from my iPhone application.

When I add “using System.Net.Mail;” to my script it gives me this error:
“error CS0246: The type or namespace name `Net.Mail’ could not be found. Are you missing a using directive or an assembly reference?”

Is this because I’m only using iPhone basic? If I upgrade to iphone advanced will I be able to access the MailMessage class?

Thanks in advance.

No…System.Net.Mail is .net 2.0, which is too advanced for Unity iPhone, which has an earlier version. A .net upgrade is unlikely because it’s already big enough; adding .net 2.0 will make it too big.

–Eric

Alternatively (if you have pro), you could call the built-in Mail app through OpenURL

Application.OpenURL(“mailto:recipient@example.com
?subject=hi!&body=Text%20goes%20here!”);

And remember, you’ve got to encode the mailto URL (eg. spaces become %20) How to Upload a Photo to Your Website

Application.OpenURL works great, but keep in mind that your game will quit and Mail will open.

You can try to send the email yourself via sockets, but you’ll need to have your own SMTP server address embedded in there.

Sounds like OpenURL will work well for what I need. Thanks everyone.

Just need to upgrade to Advanced now :slight_smile: