I have recently started a new Django website, www.darela.com, and I
have some problems with sending automatic mails.

This is a community website, where consultants, contractors and other
specialists can present themselves, publish their profiles and
describe their skills and experience, publish technical articles,
discuss news, participate in discussion boards etc.

During registration, users recieve token-based email confirmation and
are asked to verify their accounts. There is also an internal
messaging systems (between users) where messages are forwarded to
users email address, and several other cases where email are sent
automatically by the server.

Registration confirmation mails, for example, are sent from
[EMAIL PROTECTED], however, they almost invariably go directly
to user's spam folder. I know that there are many reasons why a
legitimate message can be considered spam, including the content,
discrepancy with reverse DNS, blacklists etc... However, if I
configure Outlook to use this address ([EMAIL PROTECTED]) and
send an identical message to the same user, it will go through to
user's mailbox and will not get to spam folder - even when users have
Yahoo or Hotmail account.

I am sending these messages using smtplib. I am not using Django's
send_mail because my mail server requires POP before SMTP
authentication - and I am not aware of how to have this in Django - so
I am using a modified version:

def send_mail(subject='', text='', sender='', to=''):
    M = poplib.POP3(settings.EMAIL_HOST)
    M.user(settings.EMAIL_HOST_USER)
    M.pass_(settings.EMAIL_HOST_PASSWORD)
    headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender,
to, subject)
    message = headers + text
    mailServer = smtplib.SMTP(settings.EMAIL_HOST)
    mailServer.sendmail(sender, to, message)
    mailServer.quit()

Before I start trying to insert the same headers as in Outlook, I was
wondering if someone had a similar problem before? Does anyone know
another way to achieve pop-before-smtp with Django? Or what else can I
do to avoid these messages ending up in spam folders? Any ideas?

Many thanks for your help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to