Having hard time on Network.Mail.Mime

91 views
Skip to first unread message

Ryan Monreal

unread,
Oct 7, 2015, 9:06:27 PM10/7/15
to Yesod Web Framework
It's been two weeks I'm using the Network-Mail-Mime library for my project but due to lack of experience in Haskell I want to ask some help.

Once i compile my project it runs smoothly but I don't know why the i can't receive email. 
I'm using the Mail function of the said library. and after that pass the Mail result the another function called renderSendMail :: Mail -> IO ().
as renderSendMail  will use sendmail executable for sending email my production server was on gce and it says that port 25 that uses by sendmail is block.

can anyone help me with this.

Sorry for my bad english. ^_^

Sajith Sasidharan

unread,
Oct 8, 2015, 9:54:49 AM10/8/15
to yeso...@googlegroups.com
Hi Ryan,

Sending mail is not a Haskell or Yesod problem -- this is a general
problem everyone has to face once in a while. :-)

About GCE in particular, have you seen this?

https://cloud.google.com/compute/docs/tutorials/sending-mail/

Alternatively you can use a third-party service (such as Mailgun or
Amazon SES) for email delivery. If you end up choosing Amazon SES,
the mime-mail-ses package works quite well.

Regards,
Sajith.


Ryan Monreal <ryanmon...@gmail.com> wrote:

> It's been two weeks I'm using the Network-Mail-Mime
> <http://haddocks.fpcomplete.com/fp/7.8/20140916-162/mime-mail/Network-Mail-Mime.html> library
> for my project but due to lack of experience in Haskell I want to ask some
> help.
>
> Once i compile my project it runs smoothly but I don't know why the i can't
> receive email.
> I'm using the Mail
> <http://hackage.haskell.org/package/mime-mail-0.4.2/docs/Network-Mail-Mime.html#t:Mail> function
> of the said library. and after that pass the Mail result the another
> function called renderSendMail :: Mail -> IO ()
> <http://haddocks.fpcomplete.com/fp/7.8/20140916-162/mime-mail/Network-Mail-Mime.html#v:renderSendMail>
> .
> as renderSendMail will use sendmail executable for sending email my
> production server was on gce and it says that port 25 that uses by sendmail
> is block.
>
> can anyone help me with this.
>
> Sorry for my bad english. ^_^
>


--
"the lyf so short, the craft so long to lerne."
-- Chaucer.

Jason Zoladz

unread,
Oct 9, 2015, 5:24:35 PM10/9/15
to Yesod Web Framework
I second Sajith's endorsement of mime-mail-ses. Works great, and pairs well with yesod-auth-account.

Ryan Monreal

unread,
Oct 12, 2015, 8:01:33 AM10/12/15
to Yesod Web Framework
hi Sajith & Jason,

Sorry for the late response.

thanks for the advise any tutorial about haskell and amozon ses?

Sajith Sasidharan

unread,
Oct 12, 2015, 2:24:19 PM10/12/15
to yeso...@googlegroups.com
Ryan,

I'm not completely sure, but I would hazard a guess that you're better
off configuring postfix to route email via SendGrid or Mailgun, as GCE
documentation suggests. Of course you will have to do a bit of system
administration, but that should not be too much trouble.

My reasoning is this: both SendGrid and Mailgun are GCE partners, with
a free tier, so you can experiment with this stuff without having to
deal with many surprises. You can also continue using your current
code.

I don't know about any tutorials on using Haskell and Amazon SES. In
case you're looking for an example of using mime-mail-ses, here's one:

https://github.com/snoyberg/haskellers/blob/master/Handler/Email.hs#L44

You will have to sign up for an AWS account, get SES credentials, get
verified so that you can send emails, get ready to pay 1 cent/email
(or something like that), etc.

I hope I haven't made it more complicated than necessary. :-)

Regards,
Sajith.


Ryan Monreal <ryanmon...@gmail.com> wrote:

> hi Sajith & Jason,
>
> Sorry for the late response.
>
> thanks for the advise any tutorial about haskell and amozon ses?
>
>
>
> On Thursday, October 8, 2015 at 9:06:27 AM UTC+8, Ryan Monreal wrote:
> >
> > It's been two weeks I'm using the Network-Mail-Mime
> > <http://haddocks.fpcomplete.com/fp/7.8/20140916-162/mime-mail/Network-Mail-Mime.html> library
> > for my project but due to lack of experience in Haskell I want to ask some
> > help.
> >
> > Once i compile my project it runs smoothly but I don't know why the i
> > can't receive email.
> > I'm using the Mail
> > <http://hackage.haskell.org/package/mime-mail-0.4.2/docs/Network-Mail-Mime.html#t:Mail> function
> > of the said library. and after that pass the Mail result the another
> > as renderSendMail will use sendmail executable for sending email my
> > production server was on gce and it says that port 25 that uses by sendmail
> > is block.
> >
> > can anyone help me with this.
> >
> > Sorry for my bad english. ^_^
> >
>


Reply all
Reply to author
Forward
0 new messages