[Seaside] Re: Sending e-mails

AxiNat tibabenfortlapalanca at gmail.com
Wed May 5 08:02:53 UTC 2010


That's pretty funny, my version of SMTPClient doesn't implement the method
openOnHostNamed:, the closest thing is openOnHost:port: in
TelnetProtocolClient, a superclass of SMTPClient, but using -for example-
openOnHost: smtp.gmail.com port: 465 doesn't work... fires up an error
message saying that a primitive has failed, and I'm really unable to debug
what's wrong there...

I tried connecting via telnet, the hostname and port are correct. I tried
sending the port number as a string and number, both fail. I also tried
passing it the IP address in case the name resolving wasn't working, but it
results in the same.

I'm afraid I'm gonna give up and just use sendmail, tho it bothers me a lot
to have to add yet another step to the deployment process... :(

Sorry for being such a pain!

2010/5/5 Andreas Raab <andreas.raab at gmx.de>

> Disclaimer: I can only speak for Squeak but I suspect the situation is the
> same for Pharo and the following should work.
>
> First thing you should do is to make sure you actually pass your
> credentials to SMTPClient. The example you've used doesn't do that, try this
> instead:
>
>        smtp := SMTPClient new.
>        smtp user: '<username>'.
>        smtp password: '<password>'.
>        [smtp openOnHostNamed: '<hostname>'.
>        smtp mailFrom: 'sender at domain.com'
>                to: 'rcvr at domain.com'
>                text: 'Hello from Squeak''s SMTPClient'.
>        smtp quit] ensure:[smtp close].
>
> This *should* work if you have the relevant patches for all but the most
> paranoid servers. There's a chance though that you will be rejected for
> reasons of 'NetNameResolver localHostName' returning 'localhost' or
> '127.0.0.1' and we've found there are some SMTP servers which don't like
> that Unixism (the server response should indicate that).
>
> If you run into that situation you'll have to hack SMTPClient to provide a
> custom hostname that you need to find somewhere. Can't help you there - what
> we're doing in this situation is so ugly that I'm not even going to tell you
> :-) Hopefully just providing credentials is enough.
>
> Cheers,
>  -Andreas
>
>
> On 5/4/2010 11:53 PM, AxiNat wrote:
>
>> Okay, this is what I found so far (example in SMTPClient):
>>
>> self deliverMailFrom: 'm.rueger at acm.org <mailto:m.rueger at acm.org>' to:
>> #('m.rueger at acm.org <mailto:m.rueger at acm.org>') text:
>>
>> 'Subject: this is a test
>>
>> Hello from Pharo!
>> '    usingServer: 'smtp.concentric.net <http://smtp.concentric.net>'
>>
>>
>> I tried that using my own smtp server, but it requires authentication
>> and doesn't let the e-mail go through. If I try it with a local sendmail
>> daemon, my guess is that the message is gonna end up in the spam folder
>> of most people... I remember at university we had this exercises
>> consisting on sending e-mails through sendmail and straight via telnet,
>> and they would end up classified as spam, I'm not sure whether this is
>> the same case tho...
>>
>> Does someone have further information on that patch that allows
>> authentication?
>>
>> Thanks!
>>
>> 2010/5/5 Lukas Renggli <renggli at gmail.com <mailto:renggli at gmail.com>>
>>
>>
>>    Not necessarily, you can connect to any SMTP server. I am not sure if
>>    authentication is built in nowadays, but there was a patch floating
>>    around that would add it.
>>
>>    Lukas
>>
>>    On 5 May 2010 08:19, AxiNat <tibabenfortlapalanca at gmail.com
>>    <mailto:tibabenfortlapalanca at gmail.com>> wrote:
>>     > I'm on Pharo 1.0, been checking SMTPClient, but it still looks
>>    like it needs
>>     > sendmail to be running in the system, or I may totally be
>>    missunderstanding
>>     > the way it works, which is a very plausible option possibility...
>>     >
>>     > 2010/5/5 Lukas Renggli <renggli at gmail.com <mailto:renggli at gmail.com
>> >>
>>
>>     >>
>>     >> Seaside does not provide an SMTP library, but most Smalltalk
>>    dialects
>>     >> do. On which Smalltalk are you?
>>     >>
>>     >> Lukas
>>     >>
>>     >> On 5 May 2010 07:21, AxiNat <tibabenfortlapalanca at gmail.com
>>    <mailto:tibabenfortlapalanca at gmail.com>> wrote:
>>     >> > Hi all,
>>     >> >
>>     >> > I'd like to know what's the best way to send e-mails from a
>>    seaside app,
>>     >> > so
>>     >> > far I've read about some Smalltalk SMTP library, using unix
>>    sendmail or
>>     >> > sendEmail.
>>     >> >
>>     >> > sendEmail sounds like the easiest method, but I don't like
>>    depending on
>>     >> > external tools...
>>     >> >
>>     >> > Any suggestions, tips? Any howtos around?
>>     >> >
>>     >> > Thanks!
>>     >> >
>>     >> > Bernat Romagosa.
>>     >> >
>>     >> > _______________________________________________
>>     >> > seaside mailing list
>>     >> > seaside at lists.squeakfoundation.org
>>    <mailto:seaside at lists.squeakfoundation.org>
>>
>>     >> >
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>     >> >
>>     >> >
>>     >>
>>     >>
>>     >>
>>     >> --
>>     >> Lukas Renggli
>>     >> www.lukas-renggli.ch <http://www.lukas-renggli.ch>
>>
>>     >> _______________________________________________
>>     >> seaside mailing list
>>     >> seaside at lists.squeakfoundation.org
>>    <mailto:seaside at lists.squeakfoundation.org>
>>
>>     >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>     >
>>     >
>>     > _______________________________________________
>>     > seaside mailing list
>>     > seaside at lists.squeakfoundation.org
>>    <mailto:seaside at lists.squeakfoundation.org>
>>
>>     > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>     >
>>     >
>>
>>
>>
>>    --
>>    Lukas Renggli
>>    www.lukas-renggli.ch <http://www.lukas-renggli.ch>
>>
>>    _______________________________________________
>>    seaside mailing list
>>    seaside at lists.squeakfoundation.org
>>    <mailto:seaside at lists.squeakfoundation.org>
>>
>>    http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100505/4edcdaa2/attachment.htm


More information about the seaside mailing list