WebFaction
Community site: login faq

Trying to get the error emails to ADMINS/MANAGERS to work on a new site. Copied what I did on a previous site, also consulted http://docs.webfaction.com/software/django/config.html#configuring-django-to-send-mail

  1. Set up an email address saving in a local mailbox.

  2. Added these (slightly anonymized) lines to local_settings.py:

    EMAIL_HOST = 'smtp.webfaction.com'

    EMAIL_HOST_USER = 'valnet'

    EMAIL_HOST_PASSWORD = 'password'

    DEFAULT_FROM_EMAIL = 'address@valnet.webfactional.com'

    SERVER_EMAIL = 'address@valnet.webfactional.com'

    EMAIL_SUBJECT_PREFIX = '[Value Network]'

    SEND_BROKEN_LINK_EMAILS = True

(Note: the pre tag did not handle the underscores very well in the preview (thought a lot of them meant italicize). Don't know if it will work in the message-as-posted. If you know Django, you can probably interpolate...)

  1. Restarted Apache

  2. Deliberately triggered an error. Several times.

But got no email messages. Checked spam folder, too.

What did I do wrong? Any ideas?

Thanks a lot.

asked 31 Oct '12, 10:01

bhaugen
0211
accept rate: 0%

Does your application send email correctly otherwise? Any errors in your log file?

(31 Oct '12, 11:07) bmeyer71 ♦♦

New app, has never sent email before.

error_django.log has a bunch of entries like this:

[Wed Oct 31 14:18:44 2012] [error] Subject: [Value Network]ERROR (internal IP): Internal Server Error: [Wed Oct 31 14:18:44 2012] [error] /accounting/test-error/ [Wed Oct 31 14:18:44 2012] [error] From: mailer@valnet.webfactional.com [Wed Oct 31 14:18:44 2012] [error] To: thecorrectaddress@gmail.com [Wed Oct 31 14:18:44 2012] [error] Date: Wed, 31 Oct 2012 14:18:44 -0000 [Wed Oct 31 14:18:44 2012] [error] Message-ID: 20121031141844.19496.14322@web349.webfaction.com

So it looks like the app was trying to send the emails.

I didn't see anything that looked like a mail-sending error, but then I don't know where to look for that, or what to look for. Grateful for tips.

(31 Oct '12, 14:24) bhaugen

Might be best if you open a support ticket so that we can look at your code directly.

If you would like, you could also try one of the following scripts just to make sure that you can send email.

#!/usr/bin/python

from smtplib import SMTP

from_addr = 'from@domain.com'
to_addrs = ['to@domain.com',]
msg = 'test message'

s = SMTP()
s.connect('smtp.webfaction.com')
s.login('mailbox_name','password')
s.sendmail(from_addr, to_addrs, msg)

Another example with a subject:

import smtplib
import email.utils
from email.mime.text import MIMEText

# Create the message
msg = MIMEText('This is the body of the message.')
msg['To'] = email.utils.formataddr(('<TO>', 'to@domain.com'))
msg['From'] = email.utils.formataddr(('<FROM>', 'from@domain.com'))
msg['Subject'] = 'Simple SMTP test message'

server = smtplib.SMTP('smtp.webfaction.com', 25)
server.set_debuglevel(True) # show communication with the server
server.login('mailbox_name','password!')
try:
    server.sendmail('from@domain.com', ['to@domain.com'], msg.as_string())
finally:
    server.quit()
(31 Oct '12, 14:59) bmeyer71 ♦♦

Might be best if you open a support ticket

Done. Will try the scripts later.

(31 Oct '12, 15:10) bhaugen
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×903
×259
×108

question asked: 31 Oct '12, 10:01

question was seen: 2,919 times

last updated: 31 Oct '12, 15:10

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM