sendgrid

SendGrid - Image not showing up in HTML email

ぃ、小莉子 提交于 2019-12-10 23:25:17
问题 I am using the SendGrid v3 API and C# library (v7) to send an email. In my email I have a header which is a png. The header is embedded like this: <img src="cid:emailheader"/> In the C# code I send the image as an attachment with with the same ContentId var mail = new Mail(from, subject, to, content); var headerPath = HttpContext.Current.Server.MapPath("~/Resources/email-header.png"); var attachment = new SendGrid.Helpers.Mail.Attachment(); attachment.ContentId = "emailheader"; attachment

SendGrid API error codes and messages?

岁酱吖の 提交于 2019-12-10 21:36:48
问题 I have looked all over in their site and forums and wiki, but so far I have not been able to find an answer to this question. Where can I find a list of SendGrid API error codes and messages? Thanks 回答1: Web API reference Web API v3 reference 回答2: https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html This explains each of the errors or status codes raised. if you get a 4xx, try with a different key with different permissions. if you get 2xx, you are done.if it's a 5xx, then

Trouble using SendGrid with appharbor

懵懂的女人 提交于 2019-12-10 21:03:11
问题 I am using appharbor, added SendGrid as addon, They provided me smtp host - smtp.sendgrid.com port - 587 user - 32adf793-2cbf-492c-9bb9- * ** * @apphb.com When I use these details and try to send email via my c# code, it says, "Failure Sending Email". Please help. 回答1: AppHarbor injects the relevant SMTP configuration in your application's configuration and you can send emails right off the bat using this snippet: var smtpClient = new SmtpClient(); smtpClient.Send(new MailMessage(...)); There

Node - options for sending email, sendgrid and nodemailer one of them or combined

走远了吗. 提交于 2019-12-10 20:44:56
问题 Not so experienced with sending email in node and as i can see there are different option to choose among. Which option to use in following scenario? Using node-mailer with sengrid: As i can see i must add additional package "nodemailer-sendgrid-transport" to force them to work together. Because var transporter = nodemailer.createTransport({ service: 'SendGrid', auth: {...}); won't work. (Always returning Bad username / password) var nodemailer = require('nodemailer'), sendGridTransport =

How to attach a node.js readable stream to a Sendgrid email?

限于喜欢 提交于 2019-12-10 20:25:59
问题 I'm using PDFKit to generate PDFs. I'm using Nodejitsu for hosting, so I can't save the PDFs to file, but I can save them to a readable stream. I'd like to attach that stream in a Sendgrid email, like so: sendgrid.send({ to: email, files: [{ filename: 'File.pdf', content: /* what to put here? */ }] /* ... */ }); I've tried doc.output() to no avail. 回答1: To use the SendGrid nodejs API with a streaming file, just convert the streaming into a buffer. You can convert a readable stream into a

How to handle incoming POST data from external server in Laravel

核能气质少年 提交于 2019-12-10 19:21:57
问题 I have a route for handling incoming POST data in laravel: Route::get('/sendgrid/api', 'SendGrid\EmailEventsController@parse'); Here's my controller: namespace App\Http\Controllers\SendGrid; use App\Http\Controllers\Controller; use App\Models\SendGrid\EmailEvents; class EmailEventsController extends Controller { public function parse() { $contents = file_get_contents("php://input"); $requests = json_decode($contents); $data = array(); foreach ($requests as $request) { array_push($data, array(

To give unsubscribe link in the mail using sendgrid XSMTPAPI header

随声附和 提交于 2019-12-10 15:45:30
问题 Can any one please tell me how to add unsubscribe link in the mail which is send by modifying the header.I am using Sendgrid header XSMTPAPI, although I found a relevant header called subscription track in the filters, but couldn't figure out how to use it. 回答1: You would want to have an X-SMTPAPI header that looked something like this when broken out: { filters: { subscriptiontrack: { settings: { enable: 1, "text/html": "Unsubscribe <%Here%>", "text/plain": "Unsubscribe Here: <% %>" } } } }

Including SendGrid breaks compile

北城余情 提交于 2019-12-10 15:36:12
问题 I've just downloaded SendGrid via Nuget and am trying to use it in one of my projects in a Solution. I have the following references: And referenced in my file: And this code: But I get the error "The type or namespace name 'SendGridMessage' could not be found (are you missing a using directive or assembly reference?)": What's wrong with the above? 回答1: SendGrid has now added a fork to nuget for .Net 4.0 support. If you want to keep using .Net 4.0 then you can install the SendGrid.Net40

Why CSS is not working when sending HTML email?

两盒软妹~` 提交于 2019-12-10 14:42:09
问题 As I am using SendGrid service at heroku, I've noticed that when I send HTML based emails, the CSS has no effect, can any one tell me what could be wrong ? I tried to send it as html.haml, html.erb, but both didn't work, although the images are viewed correctly in the sent emails. Any idea ? 回答1: Try using inline styles instead of an external stylesheet. Like this: <div style="color:green;" id="div"></div> instead of something like this: <style> #div{ color:green; } </style> <div id="div"><

SendGrid: applying templates to WEB API pup curl method

ぐ巨炮叔叔 提交于 2019-12-10 12:29:16
问题 I'm using this code provided by Sendgrid itself <?php // use actual sendgrid username and password in this section $url = 'https://api.sendgrid.com/'; $user = 'username'; // place SG username here $pass = 'password'; // place SG password here // grabs HTML form's post data; if you customize the form.html parameters then you will need to reference their new new names here $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; // note the