I've set up some google apps mailing groups, but emails from nodemailer to the groups are always getting 'bounced' (but no bounce-back email).
Individual gmail addresses receive the same nodemail fine. The admin email log looks like this for successful email to individual gmail user address. The email headers from the successful email show no issues (eg no spf failures).
The groups do receive emails from external users (including from the same address nodemailer uses) when sent through the gmail web client, so it it isn't a group permission issue. Successful emails to the group yields an admin log like this.
The group is set to forward all spam to users.
Nodemailer is using a gmail account, and the GApps are using a Google domain hosted address, so it shouldn't be an issue with routing or conflicting servers
What am I missing here?
This was resolved by reconfiguring the 'from' field in the nodemailer message.
// Nodemailer ignores the bad `from` value (not a valid email)
// Nodemailer sends with from ==''
// This gets bounced by google group addresses
var msg = {
from: "System",
to: "usergroupaddress#gmail.com,
subject: "Your generated email",
text: "Hello user",
html: "<p>Hello user</p>"
};
I had thought 'from' would define the name displayed on the email. It didn't do that, but it didn't cause any problems either for most email recipients. But google groups was bouncing those emails.
Nodemailer was just leaving 'from' as blank (rather than using my dummy string). Apparently this field must be a valid email address. Set it to an email address, and nodemailer will include it in the message envelope, which google groups will then stop bouncing.
// Nodemailer accepts and forwards the valid `from`
// google groups address will accept the email
var msg = {
from: "system#myserver.com",
to: "usergroupaddress#gmail.com,
subject: "Your generated email",
text: "Hello user",
html: "<p>Hello user</p>"
};
The google apps email also hints at this: emails with an empty 'from' envelope have a blank 'sender' in the google apps email log search. But as soon as I corrected nodemailer, the 'sender' started populating in email log search, and google stopped bouncing the emails. See the email log here.
I set up my site registration form with phpmailer and gsuite. email is working perfectly. but I getting this notifications top of the register page after registration. what should I do for this?
It looks like you have enabled SMTP debugging. Check your configuration for the below.
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->SMTPDebug = 2; //Alternative to above constant
PHPMailerSMTP Debugging
I have facing some difficulty on changing principal : as "Anonymous" in the email during sending an email.
My system is an online system that allow user to register their account, then Admin will just need to click the register button to register their staff in their organization.
For my understanding, Anonymous is a default account in domino system for "outsider" whoever accessing their server / website.
below is my sample coding:
var web = setdoc.getItemValueString("InternetAddress");
var maildoc:NotesDocument = database.createDocument()
maildoc.replaceItemValue("Form", "Memo");
maildoc.replaceItemValue("Subject","Request for Email Account By Applicant);
session.setConvertMime(false);
var stream = session.createStream();
stream.writeText("<html><body>");
stream.writeText("<p>Dear " + "department reviewer" + ",</p>");
stream.writeText('<p>Kindly review this request by '+document1.getItemValueString('Name')+" on "+I18n.toString(#Today(), 'dd/MM/yyyy')+ ",</p>");
stream.writeText("</body></html>");
var body = maildoc.createMIMEEntity("Body");
body.setContentFromText(stream, "text/html;charset=UTF-8", 1725);
stream.close();
maildoc.closeMIMEEntities(true);
session.setConvertMime(true);
maildoc.replaceItemValue("SendTo",document1.getItemValue("Dep_rev"));
maildoc.send();
Attached will be sample photo of my email:
Is there any way to change the Anonymous name to other name?
You are using the current session to send the mail. Therefore the sender is anonymous.
You have several options:
Use sessionAsSigner to get hold of the database and create your mail document from there. This should change the sender
Set the From and Principal fields to the name of the sender. You must include the Domino domain name at the end of the Principal field (sender#company.com#dominodomain)
Set the From and Principal fields and copy the mail directly to mail.box on the server.
Mailgun recommends creating DNS (TXT, MX,..) records for a subdomain, but states sending and receiving with the root domain is possible by later configuration. I created all necessary steps for mail.example.com at my registrar and at Mailgun (adding a domain, setting up routes, etc.).
I can now receive and send emails to the configured example#mail.example.com.
What do I have to change now to be able to send and receive at example#example.com?
What are the necessary changes at the registrar, in mailgun, and in my smtp settings at gmail (for sending from gmail via mailgun)?
Thank you very much!
If you configure Mailgun for a subdomain, you can send emails from your main domain passing a proper to variable. For instance, using Node.js + nodemailer + nodemailer-mailgun-transport:
var nodemailer = require('nodemailer'),
mg = require('nodemailer-mailgun-transport'),
auth = { api_key: 'foobar', domain: 'mail.example.com' },
nodemailerMailgun = nodemailer.createTransport(mg({ auth: auth }));
nodemailerMailgun.sendMail({
from: 'helloworld#example.com',
to: 'recipient#domain.com',
subject: 'Hey you, awesome!',
text: 'Mailgun rocks, pow pow!'
}, someCallback);
Or you can read about other methods of sending through an API in their docs. Anyway, even if your Mailgun is configured for a subdomain, you can send email from your main domain.
However (!) your MX records are configured for your subdomain, and hence you can only receive emails there. To be able to receive email to your main domain, add your main domain in Mailgun's control panel, e.g. not mail.example.com, but example.com, and make an according configuration in your DNS control panel for this main domain, example configuration for DigitalOcean's DNS for example.com (not subdomain):
TXT # v=spf1 include:mailgun.org ~all
TXT krs._domainkey k=rsa; p=MIGfM...blablabla
CNAME email mailgun.org.
MX 10 mxa.mailgun.org.
MX 10 mxb.mailgun.org.
Keep in mind, that Mailgun does not have mailbox functionality, it can only forward incoming emails, if you have an appropriate rule set. Most people delegate their main domain's MX records to a more manageable ESP, like Gmail. You can only have one set of MX records for a domain, so you have to choose, either Gmail, or Mailgun.
You need to use mailgun-js for this
Require mailgun-js from npm
var Mailgun = require('mailgun-js');
2.Set options for mailgun. i.e. apiKey and domain.
var options = {
apiKey: 'YOUR_API_KEY',
domain: 'YOUR_DOMAIN'
};
Instantiate mailgun with these options.
var mailgun = new Mailgun(options);
Send email after setting required parameter for it.
var data = {
//From email
from: '',
// Email to contact
to: 'To Email address',
// CC email
ccTo: 'CC address if any'
// Subject
subject: 'Mail subject',
// Email msg
html: 'email message or html'
};
// Send email
mailGun.messages().send(data, callbackFunction() {
});
I've only been using Mailgun a short time, but I can help with what I've learned so far.
Your DNS records can be setup for Mailgun or a third party like Gmail. I don't think they will use both. I'm not sure what that would do to the routing, because it would not know where to go.
For your Mailgun subdomain, you used mail.example.com with email address example1#mail.example.com. Mine is running, but I did not create email addresses like that at all. My email formats are still example1#example.com.
I am going to paste this in from an email I received, and edit it to match your provided example:
It looks like you have set the MX records for the root domain, example.com, however the domain you are using with Mailgun is mail.example.com. You will need to change the hostname from example.com to mail.example.com for these to route correctly.
As Mailgun does not have mailboxes, receiving email with Mailgun requires using a subdomain with MX records pointing to Mailgun as well as using our Routes functionality. A good way to understand Routes is as a sophisticated filtering and forwarding mechanism. With Routes, you can either:
forward the incoming email to another environment for storage (such as an email address or an endpoint on your server
store a message temporarily (for up to 3 days) and retrieve it using the Messages API
stop a message from being processed (i.e. dropping certain messages instead of forwarding or storing them)
If you're trying to use Django's Anymail package to send Mailgun email from a subdomain, you need to send the email using the EmailMultiAlternatives object and specify the Email Sender Domain like so:
from django.core.mail import EmailMultiAlternatives
msg = EmailMultiAlternatives("Subject", "text body",
"contact#example.com", ["to#somedomain.com"])
msg.esp_extra = {"sender_domain": "mg.example.com"}
msg.send()
I would like to preserve the Email Subject & email Message that are defined on the Docusign Template and send those vs sending generic email subject & message when sending a document via Custom Button in Salesforce? Below is my button code
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
var DST='<Docusign Template Id>';
var LA='0';
var OSO = 'Send';
var CRL = 'Email~{!Fulfillment__c.Primary_Contact_Email__c};Role~Client;FirstName~ {!Fulfillment__c.Primary_Contact_First_Name__c};LastName~{!Fulfillment__c.Primary_Contact_Last_Name__c}';
var CCRM='Client~Client';
window.location.href = '/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID='+eSignatureNotSent.Id+'&DST='+DST+'&LA='+LA+'&CRL='+CRL+'&OCO='+OCO+'&CCRM='+CCRM;
I think Docusign is using Default Email Subject and Default Email Message defined in the Admin settings in Salesforce. I do not want to send it as all the work is done when building templates in Docusign.
If you leave the Default Email Message blank in the Admin settings, it will grab the contents of the Template Email Message.
The API has a hard requirement to define an email subject through the request. Currently because Salesforce uses the API, it has to follow this guideline.
My best advice is making a custom button that defines the Email subject that you'd like for each workflow that you may have.