Send a email in Grails 3 with an image in it - image

I am trying to send an image within an email when in Development for a Grails 3 project. The email is sent through AWS email service. I have tried the img tag with absolute equal to true but have been unable to succeed in seeing the image in the email? Using asset-pipeline so it might be something related to that.
How do you achieve seeing the image in a email?

I used asynchronous send mail grails plugin for mail with image code part as follows:
File f = new File("IMG.jpg")
asynchronousMailService.sendMail {
from "senderMailID"
to "recipientsMailID"
bcc "BCCMailID"
subject "subject"
html "html code"
inline 'YourImageName', 'image/jpg', f
}
Then your HTML codes contains
<img src="cid:YourImageName" style="height: 60px">
I hope this helps you!

I would recommend you to use this grails plugin sending image or text etc. attachment through AWS.
http://grails-aws.github.io/grails-aws/1.7.5.0/guide/3%20Amazon%20Simple%20Email%20Service%20(AWS%20SES).html
And if your done with AWS mail configuration then you can use mail service like this:
Mail {
to "email#gmailcom"
subject "testing emails with one attachment"
body "..."
attach "/users/website/images/file1.jpg"
}
Hope this will help you!

Related

Is there some way to add an image as signature(not as attachments) in the email output plugin of logstash?

Actually I need to include an image as signature at the end of the email sent using logstash's email output plugin. Is there some way to do it?
I have tried it using htmlbody => ''
But it did not work.

How to send mail using OctoberCms?

How to send Email in octobercms after form submission? i created a mail from backend mail template in octobercms the mail code is contact::form.
// $data has name and email
$to = System\Models\MailSettings::get('abc#gmail.com');
Mail::sendTo($to, 'contact::form', $data);
return true;
I'm getting this error :
\Components\System\Models\MailSettings' not found
Not sure what you're using MailSettings::get('abc#gmail.com') for, but you can remove that line and simply pass in the email address:
Mail::sendTo('abc#gmail.com', 'contact::form', $data);
Did you configure the mail system correctly to send mail?
What do you need the mail settings info for?
Remove that line. I believe that email will automatically be used unless you specify it in the Mail function.
I believe you need to add the Mail class (maybe input) to your component like so:
use Mail;
use Input;

How to send custom form data to FineUploader Azure Success endpoint?

I am using FineUploader 5.13.0 with the Azure Blob Storage end point.
I have it successfully uploading files directly to blob storage, and also successfully hitting my web server success endpoint when the upload is concluded.
However, I am looking for a way to include custom data in the post to the success endpoint.
This bit in the documentation seems to imply that it is possible.
Under the section "Optional server-side tasks" for "uploadSuccess.endpoint", it says it will send
"Any parameters/form fields you have associated with the file".
However, I just cannot seem to figure out how to do that.
This issue seems to refer to it, but doesn't give enough info.
https://github.com/FineUploader/fine-uploader/issues/1313
Note, I am not referring to the feature to hook into existing HTML forms as explained on this documentation page:
"Integrating with Existing HTML Forms"
https://docs.fineuploader.com/branch/master/features/forms.html
You might be looking for FineUploader's Request params. This allows you to add extra form data.
Eg:
new qq.FineUploader({
// elided
request: {
params: {
testing: "THIS IS A TEST"
}
}
});
This will show up in the multi-part body of the request:

Send "Email with image" from struts2 application. How to access the image location in Action class

Iam on a Struts application!
I have a image in the folder at the root of the application. i.e.,
ApplicationName--> webContent --> images-->logo.jpg
Iam sending a mail using javamail . I want to use the image to create the body of the email.
Iam using the multipart able to send the mail perfectly without image Image .
But dont know how to achieve the mail with the logo.jpg image in the body ~
Please can someone specify how to :
access the image from action to send attach it to the email.
Please some one help me out !
This is easy:
just do this:
HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
String imgPath = request.getSession().getServletContext().getRealPath("/path/to/your/img");
File img = new File(imgPath);
Then you get the img file. /path/to/your/img should be the relative path to your img. in this case, it should be /images/logo.jpg

Best PHP mailing library for Codeigniter-2

Iam using CI-2 default mail class for sending emails. But it is not sending HTML based emails properly.
Can someone tell me good email sending libraries for CI2.
Thanks in advance
Try to configure the library to send html emails
$config['mailtype'] = 'html';
$this->email->initialize($config);
gmail and HTML content is a common problem; solutions have been suggested in the official CI forum with references to using Swift Mailer instead.
There is another solution I've found for poor HTML / Email Support.
Open up the Email Class:
System/Libraries/Email.php
Around Line 51 You'll see
var $send_multipart = TRUE;
Set this to FALSE and try again. I find CI's email library to be very good.

Resources