[Tutor] problem with rejected mail smtplib

Michael P. Reilly arcege at gmail.com
Sun Jul 30 11:58:40 CEST 2006


On 7/29/06, shawn bright <nephish at gmail.com> wrote:
>
> Hello there,
> i have a customer list, each with a number of email address that we send
> notifications to via text message.
> the problem is, there are a number of providers ( just two ) that reject
> our messages.
> the script goes a little something like this :
>
> Address = 'going at somewhere.net'
> From = 'me at myhost.net'
> message = 'From: me at myhost.net\r\nTo: %s\r\nSubject: %s\r\n\r\n%s' %
> (Address,'alert',message)
> server.sendmail(From, Address, message)
>
> most of the time it goes thru ok. but only some providers have a problem.
> However, those same providers get messages if i send them thru Evolution.
>
> any ideas of what to check out?
>

The second argument to SMTP.sendmail is supposed to be a sequence.  You are
sending a sequence (a string), so you do not get a complaint, but it is not
the sequence you want.  Try this:

server.sendmail(From, [Address], message)

  -Arcege

-- 
There's so many different worlds,
So many different suns.
And we have just one world,
But we live in different ones.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060730/ef7e65d6/attachment.htm 


More information about the Tutor mailing list