I use mailgun.com to send email. It provides HTTP API.
Here is a part of my code (I use Python and "requests" library to do HTTP
request):
message = {
'from': '[email protected]',
'to': addr,
'subject': _('Data exported for %(cond_type)s') % (
{'cond_type': cond_type}),
'text': body
}
rsp = requests.post(
settings.MAILGUN_URL,
auth=('api', settings.MAILGUN_API_KEY),
data=message,
files={'attachment': ('{}.csv.gz'.format(filename), stream)}
)
The email to be sent also have a CSV file attached (I'm implementing data
export).
Conversation via HTTP is less overhead than via SMTP, it is better for a
low power device like Beagle Bone.
Vào 22:01:44 UTC+7 Thứ Sáu, ngày 19 tháng 8 năm 2016, [email protected] đã
viết:
>
> Hello all,
>
> I am trying to do a (presumably) very simple task.
> I want my Beaglebone Black (BBB) to send me an email
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/ba5a0152-b271-44f3-a193-4cf5e37849f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.