Re: Sending Email from a form

Peter Sparkes <[email protected]> Thu, 12 Mar 2015 10:46:55 +0000
Newsgroups gmane.text.xml.cocoon.user
Message-ID <[email protected]>
Thank you all for your help. It is a smarthost problem with one particular email address

Peter

On 05/03/2015 17:50, Kunisch, Arne wrote:
>
> Dear Peter,
>
> you should check your notice from your email provider:
>
> https://www.bytemark.co.uk/support/document_library/smarthost/
>
> You use smtp.bytemark.co.uk as your smtp-relay.
>
> They describe in the document link above, why you should **not** do this anymore.
>
> Hope that helps,
>
> Arne
>
> *From:*Peter Sparkes [mailto:[email protected]]
> *Sent:* Thursday, March 05, 2015 6:26 PM
> *To:* [email protected]
> *Subject:* Sending Email from a form
>
> Hi
>
> I have an application that used a form to send emails.
>
> This has worked successfully for many years. However, recently  users have reported getting error 
> messages, as per the attached.
>
> My testing has shown that:
>
>   * Sometime the send email works as it should.
>   * Sometimes it does not and the user gets the attached error message.
>
>
> My email javascript is:
>
>  try {
>       mms = cocoon.getComponent(Packages.org.apache.cocoon.mail.MailSender.ROLE);
>
>       if (cocoon.parameters.host != "" || cocoon.parameters.user != "") {
>           mms.setSmtpHost("smtp.bytemark.co.uk",
>                          cocoon.parameters.user,
>                          cocoon.parameters.password);
>      }
>
>      mms.setFrom(fromemail);
>      mms.setTo(lodgeemail);
>      mms.setSubject(subject);
>      mms.setCc("[email protected]" <mailto:[email protected]>);
>
>      mms.setBody(body1, "text/plain; charset=utf-8");
>
>         //mms.addAttachment(cocoon.request.get("attachment"));
>         //mms.addAttachmentURL("cocoon:///");
>        // mms.addAttachmentURL("context://welcome.xml");
>
>      mms.send();
>
>   } finally {
>       cocoon.releaseComponent(mms);
>   }
>
> Has anybody any ideas, please.
>
> Peter Sparkes
>