I'm using
Message message = new Message(subject, body)
amazonWebService.ses.sendEmail new SendEmailRequest(source, destination, message)
to send emails from my grails application
https://github.com/agorapulse/grails-aws-sdk/blob/master/src/docs/guide/amazonWebService/ses.gdoc
how can I add attachments to the mails and send
It looks like sendEmail takes a Message that only allows a subject and a body. However, you can use sendRawEmail instead. In that case you can add an attachment, but first you have to craft a mime message to pass to sendRawEmail. The linked example shows formatting the mime message with the JavaMail library. Once you have this mime message you can use sendRawEmail to send the message.
Depending on your situation, you can also use any mail library that supports sending via SMTP and simply treat amazon SES like any other SMTP server. That may make dealing with attachments easier depending on the library's features.
Related
Not sure if this is possible. We send emails in our Spring Boot application, using MessageHelper we set the FROM. However, when the email is received we see a different from in the mail client.
So I can understand why, but we were hoping it might be possible to show a different value.
We use Gmail as the sender and have a Gmail account that the emails get sent from, so it has an email address that we will call myaccount#gmail.com
We use that address in the
spring.mail.username=myaccount#gmail.com
In the code we set the From via either MimeMessage or MimeMessageHelper, but in the end they update the same MimeMessage instance.
messageHelper.setFrom("support#mycompany.com");
message.setFrom("support#mycompany.com");
If the message gets sent and looking at the recipients mail client it show in the From column "myaccount#gmail.com". But we want it to show support#mycompany.com
I know technically the email message is sent from the myaccount#gmail.com and in the headers it can show that, but for the UI we want to show support#mycompany.com
I would like to write email client app using WinRT API that would send emails with custom headers (x-headers). Content of the header will depend on content of email. Something like in this post.
I did not find any methods or properties of the EmailMessage to do it. Is there a way to register message processor down the email send pipeline (if there is a pipeline)?
Thank you
As far as I know, modifying headers for email messages is not possible in WinRT and there is no endpoint you could have that will allow you to "intercept" the messages to modify them.
I'm unable to find any good documentation or examples of how to send an mail to an email address using Yesod.
More practically, I'll extract the information the user typed inside a simple form (name, age, body of message) and send this information as a mail to an email address.
I'm kind of lost in this task.
There are three packages I'd recommend you look at:
mime-mail, which is a package for composing emails and rendering to bytestrings. It can also send via the system sendmail executable.
mime-mail-ses, which can send mail from mime-mail via Amazon SES.
smtp-mail, which can send mail from mime-mail via an SMTP connection.
There is some discussion about sending email in the auth chapter of the Yesod book.
Yesod doesn't have mailing functions. You have to use other packages outside Yesod.
Maybe you'd want to check this short answer: https://stackoverflow.com/a/11763447/1744195
I am wondering if any email recipients may have automatically marked incoming messages as spam, only because swiftmailer was used to send the message (via google smtp, real google account)
Any info on this?
I have been using swift mailer with a gmail account to test sending emails with my web application.
Everything seems to be fine as SwiftMailer sets up the headers properly and none of my emails have ever gone into the spam folder.
When sending multipart emails, swift mailer does insert something into the headers:
multipart/alternative; boundary="_=_swift_v4_13311823894f583b352a1eb_=_
So, yes it is possible to tell if an email is sent using swift mailer as well.
i want to host a email client on my web server that allows messages to be processed via subject line, i looked into roundcube's autoreply but that was only a global message for all incoming emails, for example, if my customer emailed me with subject line HOSTING, it would be filtered and sent an auto response with an attached pdf file of our hosting plans
I would actually use Gmail's filters to do this, as otherwise it would be quite complicated. I would forward all the mail to Gmail, and use Gmail's filters (and canned response lab feature) to respond with the PDF attachment.