smtp
You are viewing an old version of this entry, click here to see latest version.
mail.Smtp
mtwin.mail.Smtp is a minimal smtp client, that you can use to send an email via a smtp host .
An usual use of mail.Smtp to send a text/plain and text/html email will be :
var p = new mtwin.mail.Part("multipart/alternative"); p.setHeader("From",from); p.setHeader("To",to); p.setDate(); p.setHeader("Subject","A Haxe e-mail !"); var h = p.newPart("text/html"); var t = p.newPart("text/plain"); h.setContent("<html><p>some html ...</p></html>"); t.setContent("some plain text..."); mtwin.mail.Smtp.send( "smtp.host.com", from, to, p.get() );
mtwin.mail.Part v1.3 has issues with php arrays, if you are targeting php an alternative mailing method is to call the native php mail() function through inline.
public static inline function mail( to:String, subject:String, message:String, ?additional_headers:String, ?additional_parameters:String ):Bool { return untyped __call__("mail", to, subject, message, additional_headers, additional_parameters); }
version #6931, modified 2009-09-02 05:18:28 by exint