Automatically send emails using an Alias
I'm creating an app that automatically sends emails to different users of a Google Group, where the email sender is the Google Group address.
The app is written in Python and is using Mandrill to send the emails. The distribution of the emails is working properly, but I need to sender email to be the Google Group. I have it setup as an alias on my Gmail, which allows me to manually select the alias and send emails from the Google Groups address. I am looking for a way to automatically send the emails from the alias without me having to manually send it from Gmail.
gmail gmail-imap google-groups
add a comment |
I'm creating an app that automatically sends emails to different users of a Google Group, where the email sender is the Google Group address.
The app is written in Python and is using Mandrill to send the emails. The distribution of the emails is working properly, but I need to sender email to be the Google Group. I have it setup as an alias on my Gmail, which allows me to manually select the alias and send emails from the Google Groups address. I am looking for a way to automatically send the emails from the alias without me having to manually send it from Gmail.
gmail gmail-imap google-groups
add a comment |
I'm creating an app that automatically sends emails to different users of a Google Group, where the email sender is the Google Group address.
The app is written in Python and is using Mandrill to send the emails. The distribution of the emails is working properly, but I need to sender email to be the Google Group. I have it setup as an alias on my Gmail, which allows me to manually select the alias and send emails from the Google Groups address. I am looking for a way to automatically send the emails from the alias without me having to manually send it from Gmail.
gmail gmail-imap google-groups
I'm creating an app that automatically sends emails to different users of a Google Group, where the email sender is the Google Group address.
The app is written in Python and is using Mandrill to send the emails. The distribution of the emails is working properly, but I need to sender email to be the Google Group. I have it setup as an alias on my Gmail, which allows me to manually select the alias and send emails from the Google Groups address. I am looking for a way to automatically send the emails from the alias without me having to manually send it from Gmail.
gmail gmail-imap google-groups
gmail gmail-imap google-groups
asked Jan 3 at 16:04
DanielDaniel
114
114
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can try using the Users.settings.sendAs
resource.
Settings associated with a send-as alias, which can be either the
primary login address associated with the account or a custom "from"
address. Send-as aliases correspond to the "Send Mail As" feature in
the web interface.
{
"sendAsEmail": string,
"displayName": string,
"replyToAddress": string,
"signature": string,
"isPrimary": boolean,
"isDefault": boolean,
"treatAsAlias": boolean,
"smtpMsa": {
"host": string,
"port": integer,
"username": string,
"password": string,
"securityMode": string
},
"verificationStatus": string
}
The sendAsEmail
property of this resource stands for the email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.
For other information about managing aliases, you can check out this documentation.
add a comment |
Here is code example how to send email via SMTP by using python. You can configure "From" field so it will be used as sender. Please pay attention there are python libraries being used: smtplib, os and email.
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"
msg['From'] = "John Doe <john@doe.com>" # Your from name and email address
msg['To'] = "recipient@example.com"
text = "Mandrill speaks plaintext"
part1 = MIMEText(text, 'plain')
html = "<em>Mandrill speaks <strong>HTML</strong></em>"
part2 = MIMEText(html, 'html')
username = os.environ['MANDRILL_USERNAME']
password = os.environ['MANDRILL_PASSWORD']
msg.attach(part1)
msg.attach(part2)
s = smtplib.SMTP('smtp.mandrillapp.com', 587)
s.login(username, password)
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()
For more information check this link How to Send via SMTP with Popular Programming Languages?
add a comment |
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54025869%2fautomatically-send-emails-using-an-alias%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can try using the Users.settings.sendAs
resource.
Settings associated with a send-as alias, which can be either the
primary login address associated with the account or a custom "from"
address. Send-as aliases correspond to the "Send Mail As" feature in
the web interface.
{
"sendAsEmail": string,
"displayName": string,
"replyToAddress": string,
"signature": string,
"isPrimary": boolean,
"isDefault": boolean,
"treatAsAlias": boolean,
"smtpMsa": {
"host": string,
"port": integer,
"username": string,
"password": string,
"securityMode": string
},
"verificationStatus": string
}
The sendAsEmail
property of this resource stands for the email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.
For other information about managing aliases, you can check out this documentation.
add a comment |
You can try using the Users.settings.sendAs
resource.
Settings associated with a send-as alias, which can be either the
primary login address associated with the account or a custom "from"
address. Send-as aliases correspond to the "Send Mail As" feature in
the web interface.
{
"sendAsEmail": string,
"displayName": string,
"replyToAddress": string,
"signature": string,
"isPrimary": boolean,
"isDefault": boolean,
"treatAsAlias": boolean,
"smtpMsa": {
"host": string,
"port": integer,
"username": string,
"password": string,
"securityMode": string
},
"verificationStatus": string
}
The sendAsEmail
property of this resource stands for the email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.
For other information about managing aliases, you can check out this documentation.
add a comment |
You can try using the Users.settings.sendAs
resource.
Settings associated with a send-as alias, which can be either the
primary login address associated with the account or a custom "from"
address. Send-as aliases correspond to the "Send Mail As" feature in
the web interface.
{
"sendAsEmail": string,
"displayName": string,
"replyToAddress": string,
"signature": string,
"isPrimary": boolean,
"isDefault": boolean,
"treatAsAlias": boolean,
"smtpMsa": {
"host": string,
"port": integer,
"username": string,
"password": string,
"securityMode": string
},
"verificationStatus": string
}
The sendAsEmail
property of this resource stands for the email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.
For other information about managing aliases, you can check out this documentation.
You can try using the Users.settings.sendAs
resource.
Settings associated with a send-as alias, which can be either the
primary login address associated with the account or a custom "from"
address. Send-as aliases correspond to the "Send Mail As" feature in
the web interface.
{
"sendAsEmail": string,
"displayName": string,
"replyToAddress": string,
"signature": string,
"isPrimary": boolean,
"isDefault": boolean,
"treatAsAlias": boolean,
"smtpMsa": {
"host": string,
"port": integer,
"username": string,
"password": string,
"securityMode": string
},
"verificationStatus": string
}
The sendAsEmail
property of this resource stands for the email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.
For other information about managing aliases, you can check out this documentation.
answered Jan 4 at 5:44
JacqueJacque
41118
41118
add a comment |
add a comment |
Here is code example how to send email via SMTP by using python. You can configure "From" field so it will be used as sender. Please pay attention there are python libraries being used: smtplib, os and email.
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"
msg['From'] = "John Doe <john@doe.com>" # Your from name and email address
msg['To'] = "recipient@example.com"
text = "Mandrill speaks plaintext"
part1 = MIMEText(text, 'plain')
html = "<em>Mandrill speaks <strong>HTML</strong></em>"
part2 = MIMEText(html, 'html')
username = os.environ['MANDRILL_USERNAME']
password = os.environ['MANDRILL_PASSWORD']
msg.attach(part1)
msg.attach(part2)
s = smtplib.SMTP('smtp.mandrillapp.com', 587)
s.login(username, password)
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()
For more information check this link How to Send via SMTP with Popular Programming Languages?
add a comment |
Here is code example how to send email via SMTP by using python. You can configure "From" field so it will be used as sender. Please pay attention there are python libraries being used: smtplib, os and email.
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"
msg['From'] = "John Doe <john@doe.com>" # Your from name and email address
msg['To'] = "recipient@example.com"
text = "Mandrill speaks plaintext"
part1 = MIMEText(text, 'plain')
html = "<em>Mandrill speaks <strong>HTML</strong></em>"
part2 = MIMEText(html, 'html')
username = os.environ['MANDRILL_USERNAME']
password = os.environ['MANDRILL_PASSWORD']
msg.attach(part1)
msg.attach(part2)
s = smtplib.SMTP('smtp.mandrillapp.com', 587)
s.login(username, password)
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()
For more information check this link How to Send via SMTP with Popular Programming Languages?
add a comment |
Here is code example how to send email via SMTP by using python. You can configure "From" field so it will be used as sender. Please pay attention there are python libraries being used: smtplib, os and email.
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"
msg['From'] = "John Doe <john@doe.com>" # Your from name and email address
msg['To'] = "recipient@example.com"
text = "Mandrill speaks plaintext"
part1 = MIMEText(text, 'plain')
html = "<em>Mandrill speaks <strong>HTML</strong></em>"
part2 = MIMEText(html, 'html')
username = os.environ['MANDRILL_USERNAME']
password = os.environ['MANDRILL_PASSWORD']
msg.attach(part1)
msg.attach(part2)
s = smtplib.SMTP('smtp.mandrillapp.com', 587)
s.login(username, password)
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()
For more information check this link How to Send via SMTP with Popular Programming Languages?
Here is code example how to send email via SMTP by using python. You can configure "From" field so it will be used as sender. Please pay attention there are python libraries being used: smtplib, os and email.
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello from Mandrill, Python style!"
msg['From'] = "John Doe <john@doe.com>" # Your from name and email address
msg['To'] = "recipient@example.com"
text = "Mandrill speaks plaintext"
part1 = MIMEText(text, 'plain')
html = "<em>Mandrill speaks <strong>HTML</strong></em>"
part2 = MIMEText(html, 'html')
username = os.environ['MANDRILL_USERNAME']
password = os.environ['MANDRILL_PASSWORD']
msg.attach(part1)
msg.attach(part2)
s = smtplib.SMTP('smtp.mandrillapp.com', 587)
s.login(username, password)
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()
For more information check this link How to Send via SMTP with Popular Programming Languages?
answered Jan 10 at 13:39
Anton PanteleevAnton Panteleev
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54025869%2fautomatically-send-emails-using-an-alias%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown