We want to have an application that uses an API (Graph Office365 REST) to go through emails messages and lists the recipient email aliases. Our email user has couple of aliases through which we can receive email into the same inbox.
for example - primaryEmail#my-company.com (primary email)
aliases - primaryEmail.alias1#my-company.com (alias 1) and primaryEmail.alias2#my-company.com (alias 2)
when we send emails to primaryEmail.alias1#my-company.com the email is received correctly against primaryEmail#example.com inbox. When I use the API (me/messages/{ID} or me/messages/{ID}?$select=internetMessageHeaders) to list the properties of the email Alias propterty is missing and the ToRecipients property is already resolved to primaryEmail#my-company.com.
Is there a way to enable the toRecipient email Alias property in the Message object. Please help...
Thanks in advance,
Related
I'm using ruby to send transactional emails via Mandrill.
As part of my product, I want to be able to send the same email to two recipients and have them see each other's email address.
(Like an introduction mail between two people).
So I filled he "to" field with both emails, and on my dashboard is seems that both are sent.
But unfortunately only one of the recipients receive the mail and the details of the second recipient is hidden.
In conclusion, I have two problems:
Only one recipient gets the mail
Hidden details of the second recipient.
I approached Mandrill support and this is what they replied:
If you'd like to enable this option globally for all of the messages you send, then you'll want to ensure that you have the
"Expose The List Of Recipients When Sending To Multiple Addresses"
option enabled in your Sending Defaults.
If, instead of making that change globally, you'd like to enable it
for individual messages, you'll want to use the
X-MC-PreserveRecipients (SMTP header), or the preserve_recipients (API
parameter), and set it to 'true'.
If you set this option to true, we'll expose the list of recipients to
each other as you would see happen when sending mail from a typical
email client program.
It worked!
If you want both recipients to be able to see each other, you can pass an array of e-mails in the to option.
If you do not want either of them to see each other, you can, in a loop over the users, send said e-mail.
If using ActionMailer it can be done like so:
mail(
to: ['person1#gmail.com', 'person2#gmail.com']
)
Or in a loop:
[user1, user2].each do |user|
UserMailer.some_email(user).deliver_now
end
mail(
to: user.email
)
Post your code, I have an idea of what your problem may be. Remember that a method in an ActionMailer class should only return mail() and must not be looped over inside of that method.
tldr: do everything unrelated to e-mail outside mailer, pass through necessary data as params to the method, end method with mail() call.
I have set up a contact form on my site for users to send messages to me to get in contact.
The WebMail.Send() method of sending a message works fine but the problem is, when I receive the e-mail it is received from the e-mail that I have defined for the SMTP client.
The call for sending the mail looks like this:
WebMail.Send(mailMessage.To[0].Address, mailMessage.Subject, mailMessage.Body, mailMessage.From.Address);
What I want to know is how do I get the messages to send using this method but receive to me with the MailMessage's from address rather than my SMTP account address?
mailMessage.From = New MailAddress("whatever#yourdomain.com")
I have a Rails 3 application that will send mails out to members of a group.
I would like to be able to send out the mails with a single ActionMailer call but specify all the recipients as an array of addresses, e.g.
Emailer.send_newsletters(['user1#domain.tld', 'user2#domain.tld'])
...
def send_newsletters(addresses)
mail :to => addresses, :subject => 'My newsletter to you'
end
Rails will by default make all the recipients visible when sending the mail but I would like that each recipient only sees his own name instead of all.
I will not use a dummy recipient and BCC all real recipients - it needs to be the right recipient.
Is there any way to send the mails without creating a loop around the addresses myself?
No, there isn't. You can send the email to a list of recipients, but they will see all the other recipients. You can assign the recipients to bcc, but the user won't see its address.
The only way to have the user see its own address is to loop all the elements and send one email for each recipient.
If I send the mail to the list of recipients. After that the confirmation mail is send to single person using campaign monitor api.But I want to send the confirmation mail to two or more recipients. could you please answer for this one.
like this:
send = campaign.send!({ :campaignID => campaign.campaignID, :confirmationEmail => #email.from_email, :sendDate => 'Immediately' })
how can i change it for multi recipients.
I don't think Campaign Monitor supports sending multiple campaign confirmations, however you can simply swap out the single email address for an email forwarder on your server which goes to multiple recipients.
I have to send automatic emails with Return Receipt (aka "acknowledgement of receipt"), to have the confirmation that the receiver have actually received and read the email. The confirmation is a simple email sent to a specified address (the "Disposition-Notification-To" address, given in the email header).
Do you know if there is an easy way to do that with Rails (ActionMailer)? or with Ruby perhaps (TMail, Net/SMTP)?
Thanks in advance for your help.
You set your headers in your mailer def block like so:
headers['Return-Receipt-To'] = 'email#example.com'
headers['Disposition-Notification-To'] = 'email#example.com'
headers['X-Confirm-Reading-To'] = 'email#example.com'
Note that these trigger a dialogue in some, but not all email clients. Also, it is not a guarantee that the receiver actually has read and understood the email.