haXe Forum > Send email with Haxe/PHP?

  • Anyone know how to send an email with Haxe/PHP? I tried 'mtwin.mail.Smtp' (v1.4) but it seems to be Haxe/Neko-only.

  • you have to use 'magic' because its not in the language for some reason.

    var to:String = "eddy@yahoo.com";
    untyped __php__("$message = 'hello this is the message';$message = wordwrap($message, 70);mail($to, 'email title', $message);");

  • It true, there is currently no access to the mail function via the haXe API, but you could use The haXe Magic

    var message:String = "Hello";
    var to:String = "foo@bar.com";
    untyped __call__('mail', $to, 'title', 'message');
    If you need more advanced mail features, maybe consider to write a wrapper arround an exisiting PHP-native e-mail class.

  • Thanks.
    .
    I'm thinking of modifying 'mtwin.mail.Smpt' to use that magic to call PEAR Mail when compiling for PHP instead of Neko (and maybe falling back on PHP's more basic mail() when PEAR Mail isn't available).
    .
    What is the proper procedure for submitting enhancement patches to the mtwin library?

  • I've gone ahead and made the changes and submitted a patch here:
    http://code.google.com/p/haxe/issues/detail?id=88&can=1&q=reporter%3Ansetbtgnws&colspec=ID%20Type%20Status%20Priority%20Platform%20Milestone%20Owner%20Summary

< Prev | Page 1 / 1 | Next >