Skip to main content
nikos101
Inspiring
February 3, 2010
Answered

coldfusion.service.Mail, how to send in action script

  • February 3, 2010
  • 1 reply
  • 1181 views

how do I send mail in action script using the   coldfusion.service.Mail, class.

I've set up my confix in MXML and then try this:

var mail:Mail = new Mail();
                        mail.server = conf.cfServer;
                        mail.to = "nikos@test.co.uk";
                        mail.subject = "FX ";
                        mail.content = emailText;
                        mail.from= "noreply@test.co.uk";

how do I send the mail?

This topic has been closed for replies.
Correct answer Adam Cameron.

I've never needed to use this feature, but according to the docs, you're probably after the execute() method:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/coldfusion/service/mxml/Mail.html#execute%28%29

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSD2AA37E2-E65E-4299-BE5B-0C8ED8B2B4B5.html

--

Adam

1 reply

Adam Cameron.Correct answer
Inspiring
February 3, 2010

I've never needed to use this feature, but according to the docs, you're probably after the execute() method:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/coldfusion/service/mxml/Mail.html#execute%28%29

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSD2AA37E2-E65E-4299-BE5B-0C8ED8B2B4B5.html

--

Adam

nikos101
nikos101Author
Inspiring
February 3, 2010

Awsome

I get an error:

Unable to invoke CFC - A problem occurred when attempting to deliver mail." faultCode="Server.Processing" faultDetail="This exception was caused by: javax.mail.MessagingException: Could not connect to SMTP host: secret port: 25;
  nested exception is:

This is strange because my coldfusion server "secret" has the mail section set up in the administer.

why would the mail be trying to send mail from "secret"

    <mxml:Config id="conf" cfServer="secret
        serviceUserName="flexUser" servicePassword="QWE3" />

  <mxml:Mail id="clientMarginChangeEmail"
        server="{conf.cfServer}"
        to="nikos@
test.co.uk"
     
        subject="FX Option Margins changed"
        from="noreply@test.co.uk"
        type="html" charset="utf-8" mailerId="CF" priority="1"
        timeout="60" useTLS="true" wrapText="5"
        result="handleResult(event)"
        fault="handleError(event)"
    />

Inspiring
February 3, 2010

This is strange because my coldfusion server "secret" has the mail section set up in the administer.

why would the mail be trying to send mail from "secret"

  

Hmmm... where would you expect your CF server to send email from?

Can your CF server connect to your SMTP server?  And can you send email from it (ie: with a <cfmail> tag)?

--

Adam