How to send email by using MailKit?

The first thing you need to do is follow Google’s instructions for obtaining OAuth 2.0 credentials for your application. Once you’ve done that, the easiest way to obtain an access token is to use Google’s Google.Apis.Auth library: var certificate = new X509Certificate2 (@”C:\path\to\certificate.p12″, “password”, X509KeyStorageFlags.Exportable); var credential = new ServiceAccountCredential (new ServiceAccountCredential .Initializer (“[email protected]”) { … Read more

How to send a message successfully using the new Gmail REST API?

got it! after reading the RFC 2822 specification I found out, that the complete message needs to be passed in the raw parameter, see the example: From: John Doe <[email protected]> To: Mary Smith <[email protected]> Subject: Saying Hello Date: Fri, 21 Nov 1997 09:55:06 -0600 Message-ID: <[email protected]> This is a message just to say hello. So, … Read more

Django 1.8 sending mail using gmail SMTP

for me in settings.py: EMAIL_USE_TLS = True EMAIL_HOST = ‘smtp.gmail.com’ EMAIL_HOST_USER = ‘[email protected]’ EMAIL_HOST_PASSWORD = ‘test’ EMAIL_PORT = 587 and views.py: from django.core.mail import EmailMessage email = EmailMessage(‘title’, ‘body’, to=[email]) email.send() and: https://accounts.google.com/DisplayUnlockCaptcha and also make sure you turn on permission for less secure apps.

Is there a work around google disabling “Less secure apps”?

You could try authentification via “App password”. On your Google account: set 2-Step Verification ON create 16-character “App password”( How to create app password) -> result should be similar to: 16-character “App password” Instead of Google account password use 16-character password MailMessage mail = new MailMessage(); foreach (string receiver in DolociPrejemnike()) mail.To.Add(receiver); mail.From = new … Read more

SmtpClient with Gmail

Gmail’s SMTP server requires you to authenticate your request with a valid gmail email/password combination. You do need SSL enabled as well. Without actually being able to see a dump of all your variables being passed in the best guess I can make is that your Credentials are invalid, make sure you’re using a valid … Read more

What is the proper way to ACTUALLY SEND mail from (Python) code?

Your understanding of how mail works is roughly correct. Some additional notes that may clear things up: SMTP is used for two distinct purposes. You seem to be confusing these two.: The first use, typically called “submission”, is to send a mail from an MUA (Mail User Agent, your mail program, Outlook, Thunderbird, …) to … Read more

How to open mailto links in new tab for users that have gmail as the default mail handler?

Okay, so I was able to get this working in Chrome on Mac. Your mileage may vary. Also, this is pretty hacky IMO, so it may not be worth it. Honestly this should exist as a setting within Chrome, and the behavior should be delegated to the website. E.g. Chrome should have an option: “[x] … Read more

How to send a mail directly to SMTP server without authentication?

Thats a real good question, and i am replying inline. I would like to send an email directly from a script to a Gmail email account, by connecting directly to smtp.gmail.com. First of all smtp.gmail.com is not a mailserver which accepts mail (from other mailservers), but rather allow Gmail users to login and hence send … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)