I’d recently been having problems sending mail from one of the mail accounts on my iPhone. There was no error message. The mail just wasn’t being sent.
Re-booting the iPhone appeared on occasion to fix the problem, but I couldn’t put my finger on exactly what the issue was until I noticed when it was happening.
For a while I was using the excellent swiftmailer which performed perfectly on both my local and remote servers for a while, but subsequently ceased working on my remote server.
A great alternative is the PEAR Mail package. Both MAMP and XAMPP come with the PEAR framework pre-configured, so installing the Mail package is straightforward.