Sending HTML mail using a shell script

First you need to compose the message. The bare minimum is composed of these two headers: MIME-Version: 1.0 Content-Type: text/html … and the appropriate message body: <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html> <head><title></title> </head> <body> <p>Hello, world!</p> </body> </html> Once you have it, you can pass the appropriate information to the mail … Read more

Given an email as raw text, how can I send it using PHP?

I had the same problem but found a solution that seams to work. Open a socket in PHP and “telnetting” the raw emaildata. Something like this: $lSmtpTalk = array( array(‘220’, ‘HELO my.hostname.com’.chr(10)), array(‘250’, ‘MAIL FROM: [email protected]’.chr(10)), array(‘250’, ‘RCPT TO: [email protected]’.chr(10)), array(‘250’, ‘DATA’.chr(10)), array(‘354′, $lTheRawEmailStringWithHeadersAndBody.chr(10).’.’.chr(10)), array(‘250’, ‘QUIT’.chr(10)), array(‘221’, ”)); $lConnection = fsockopen(‘mail.anotherhost.dk’, 25, $errno, $errstr, 1); … Read more

Send emails with international accent and special characters

You need to use MIME. Add mail headers: MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 (If you are already using a MIME multipart/alternative to put HTML and text in the same mail, you put the Content-Type: text/plain;charset=utf-8 on the sub-headers of the text part instead.) This is assuming that the encoding you’ll be sending your “international” characters in … Read more

iphone email attachment

You do not have to type extension in your filename. like “iphone.jpg” is not working. just write “iphone” in filename because you already define mimeType. And also you have to define path for resource. Below is the sample code to attach “rainy.png” file with mail. MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker … Read more

Android How to create Intent Filter for custom file extension that does NOT make it part of a chooser for everything on the phone

The only way to solve this problem is add scheme and host attributes to your intent filter: <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <data android:scheme=”file” /> <data android:mimeType=”*/*” /> <data android:pathPattern=”.*\\.tgtp” /> <data android:host=”*” /> </intent-filter> That is because in documentation says that android:pathPattern only works if has an scheme and host defined. http://developer.android.com/guide/topics/manifest/data-element.html … Read more