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: <a href="http://smtp.gmail.com">smtp.gmail.com</a> 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...<br>
<br>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.<br>
<br>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... :(<br><br>Sorry for being such a pain!<br><br><div class="gmail_quote">
2010/5/5 Andreas Raab <span dir="ltr"><<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Disclaimer: I can only speak for Squeak but I suspect the situation is the same for Pharo and the following should work.<br>
<br>
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:<br>
<br>
smtp := SMTPClient new.<br>
smtp user: '<username>'.<br>
smtp password: '<password>'.<br>
[smtp openOnHostNamed: '<hostname>'.<br>
smtp mailFrom: '<a href="mailto:sender@domain.com" target="_blank">sender@domain.com</a>'<br>
to: '<a href="mailto:rcvr@domain.com" target="_blank">rcvr@domain.com</a>'<br>
text: 'Hello from Squeak''s SMTPClient'.<br>
smtp quit] ensure:[smtp close].<br>
<br>
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).<br>
<br>
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.<br>
<br>
Cheers,<br>
-Andreas<div class="im"><br>
<br>
On 5/4/2010 11:53 PM, AxiNat wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Okay, this is what I found so far (example in SMTPClient):<br>
<br></div>
self deliverMailFrom: '<a href="mailto:m.rueger@acm.org" target="_blank">m.rueger@acm.org</a> <mailto:<a href="mailto:m.rueger@acm.org" target="_blank">m.rueger@acm.org</a>>' to:<br>
#('<a href="mailto:m.rueger@acm.org" target="_blank">m.rueger@acm.org</a> <mailto:<a href="mailto:m.rueger@acm.org" target="_blank">m.rueger@acm.org</a>>') text:<div class="im"><br>
'Subject: this is a test<br>
<br>
Hello from Pharo!<br></div>
' usingServer: '<a href="http://smtp.concentric.net" target="_blank">smtp.concentric.net</a> <<a href="http://smtp.concentric.net" target="_blank">http://smtp.concentric.net</a>>'<div class="im"><br>
<br>
I tried that using my own smtp server, but it requires authentication<br>
and doesn't let the e-mail go through. If I try it with a local sendmail<br>
daemon, my guess is that the message is gonna end up in the spam folder<br>
of most people... I remember at university we had this exercises<br>
consisting on sending e-mails through sendmail and straight via telnet,<br>
and they would end up classified as spam, I'm not sure whether this is<br>
the same case tho...<br>
<br>
Does someone have further information on that patch that allows<br>
authentication?<br>
<br>
Thanks!<br>
<br></div>
2010/5/5 Lukas Renggli <<a href="mailto:renggli@gmail.com" target="_blank">renggli@gmail.com</a> <mailto:<a href="mailto:renggli@gmail.com" target="_blank">renggli@gmail.com</a>>><div class="im"><br>
<br>
Not necessarily, you can connect to any SMTP server. I am not sure if<br>
authentication is built in nowadays, but there was a patch floating<br>
around that would add it.<br>
<br>
Lukas<br>
<br>
On 5 May 2010 08:19, AxiNat <<a href="mailto:tibabenfortlapalanca@gmail.com" target="_blank">tibabenfortlapalanca@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:tibabenfortlapalanca@gmail.com" target="_blank">tibabenfortlapalanca@gmail.com</a>>> wrote:<br>
> I'm on Pharo 1.0, been checking SMTPClient, but it still looks<br>
like it needs<br>
> sendmail to be running in the system, or I may totally be<br>
missunderstanding<br>
> the way it works, which is a very plausible option possibility...<br>
><br></div>
> 2010/5/5 Lukas Renggli <<a href="mailto:renggli@gmail.com" target="_blank">renggli@gmail.com</a> <mailto:<a href="mailto:renggli@gmail.com" target="_blank">renggli@gmail.com</a>>><div class="im"><br>
>><br>
>> Seaside does not provide an SMTP library, but most Smalltalk<br>
dialects<br>
>> do. On which Smalltalk are you?<br>
>><br>
>> Lukas<br>
>><br>
>> On 5 May 2010 07:21, AxiNat <<a href="mailto:tibabenfortlapalanca@gmail.com" target="_blank">tibabenfortlapalanca@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:tibabenfortlapalanca@gmail.com" target="_blank">tibabenfortlapalanca@gmail.com</a>>> wrote:<br>
>> > Hi all,<br>
>> ><br>
>> > I'd like to know what's the best way to send e-mails from a<br>
seaside app,<br>
>> > so<br>
>> > far I've read about some Smalltalk SMTP library, using unix<br>
sendmail or<br>
>> > sendEmail.<br>
>> ><br>
>> > sendEmail sounds like the easiest method, but I don't like<br>
depending on<br>
>> > external tools...<br>
>> ><br>
>> > Any suggestions, tips? Any howtos around?<br>
>> ><br>
>> > Thanks!<br>
>> ><br>
>> > Bernat Romagosa.<br>
>> ><br>
>> > _______________________________________________<br>
>> > seaside mailing list<br>
>> > <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div>
<mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>><div class="im"><br>
>> > <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Lukas Renggli<br></div>
>> <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a> <<a href="http://www.lukas-renggli.ch" target="_blank">http://www.lukas-renggli.ch</a>><div class="im"><br>
>> _______________________________________________<br>
>> seaside mailing list<br>
>> <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div>
<mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>><div class="im"><br>
>> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
><br>
><br>
> _______________________________________________<br>
> seaside mailing list<br>
> <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div>
<mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>><div class="im"><br>
> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Lukas Renggli<br></div>
<a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a> <<a href="http://www.lukas-renggli.ch" target="_blank">http://www.lukas-renggli.ch</a>><div class="im"><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div>
<mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>><div class="im"><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></blockquote>
<br><div><div></div><div class="h5">
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>