I have the following Meteor code, with Meteor's default Mailgun SMTP settings:
Email.send({
to: "customer#gmail.com,
from: "company#gmail.com",
replyTo: "company#gmail.com",
subject: 'Test',
text: "Test"
});
The email sends fine, but when the customer clicks "reply" in Gmail, it replies to "customer#gmail.com" instead of "company#gmail.com".
Make sure you're not hitting "reply all" instead of "reply".
I have just tested and it's working as expected on my end with the latest meteor and the email module.
Best,
Related
I have a Wordpress REST-API Backend with a UI5 JavaScript Frontend which loads some Post-Data to list them.
I want to protect this by a simple Login-Form in the Frontend.
To fetch and create the posts i use Node-WPAPI with basic authencation, like this:
this._oWp = new WPAPI({
endpoint: 'http://<domain>/wordpress/wp-json',
username: '<user>',
password: '<pass>'
});
But this approach dont fit my needs, because creating this WPAPI instance is even possible with a wrog password. Thus i would have to send a request to protected route first to know if my password was correct.
To directly know if my login was correct my idea was to firstly get a Token via "JWT Authentication for WP-API" and this actually works and i get the token.
But doing this my WPAPI Endpoints resulting with error "jwt_auth_bad_auth_header, "Authorization header malformed."
Is there a way to use WPAPI together with JWT Auth? Or how could a Login be authenticated by WPAPI Instance and get directly notified when the login credential were wrong?
I managed this with the WPAPI-Only-Approach, so proving that the user entered the right credentials by simply sending a request to .users().me() which needs a correct authentification. Otherwise you get an "Not authenticated" Error.
let oWp = new WPAPI({
endpoint: <your_endpoint>,
username: this._oAuth.getProperty("/Username"),
password: this._oAuth.getProperty("/Password"),
});
oWp.users().me()
.then( user => {
this._oWp.setData(oWp);
this._oRouter.navTo('home');
}).catch( error => {
console.log(error);
});
Hi I have followed these steps https://firebase.google.com/docs/dynamic-links/ios/receive and
https://firebase.google.com/docs/auth/ios/email-link-auth#before_you_begin.
However when I come to run
FirebaseAuth.instance.sendSignInLinkToEmail(
email: "my email",
actionCodeSettings: ActionCodeSettings(
url: "https://myapp.firebaseapp.com",
iOS: {
"bundleId": "my bundleId"
},
android: {
"packageName": "mypackagename",
"installApp": true,
"minimumVersion": "21"
},
handleCodeInApp: true,
)
)
However the no error occurs and no email is sent to my email address.
I have wasted 2.5 days of my life. Any suggestions will help, thanks.
I was also facing the same issue yesterday and after multiple trials i found out that in ActionCodeSettings, url you're passing should be whitelisted in firebase sign-in method.
For example, if you've added domain name example.com in firebase sign-in method then url in ActionCodeSettings must have https://example.com/... and the rest paramter will be same as it is.
For whitelisting your domain,
Go to Firebase Console > Authentication > Sign-in Method > Add domain
click on add domain to whitelist your domain
Hi I am trying set up my gmail account to send email for my Meteor app, not very easy so far
server.js
Meteor.startup(function () {
smtp = {
username: 'xxxxx', // eg: server#gentlenode.com
password: 'YYYYYYYY', // eg: 3eeP1gtizk5eziohfervU
server: 'smtp.gmail.com', // eg: mail.gandi.net
port: 465
}
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '#' + encodeURIComponent(smtp.server) + ':' + smtp.port;
});
Email.send({
from: "meteor.email.2014#gmail.com",
to: "xxxx#gmail.com",
subject: "Meteor Can Send Emails via Gmail",
text: "Its pretty easy to send emails via gmail."
});
And the testing email is never sent with the below error code saying that I havent set the environment variable.
I20150715-18:14:02.641(0)? ====== BEGIN MAIL #0 ======
I20150715-18:14:02.642(0)? (Mail not sent; to enable sending, set the MAIL_URL environment variable.)
I20150715-18:14:02.643(0)? MIME-Version: 1.0
I20150715-18:14:02.643(0)? From: meteor.email.2014#gmail.com
I20150715-18:14:02.643(0)? To: xxxx#gmail.com
I20150715-18:14:02.643(0)? Subject: Meteor Can Send Emails via Gmail
I20150715-18:14:02.643(0)? Content-Type: text/plain; charset=utf-8
I20150715-18:14:02.643(0)? Content-Transfer-Encoding: quoted-printable
I20150715-18:14:02.644(0)?
I20150715-18:14:02.644(0)? Its pretty easy to send emails via gmail.
I20150715-18:14:02.645(0)? ====== END MAIL #0 ======
Could this be due I am running this on C9?
Thanks
Sucks that cloud9 does not permit the setting of environment variables. Perhaps you can set the Meteor.settings object rather than an environment variable?
http://docs.meteor.com/#/full/meteor_settings
Essentially, you can pass JSON to meteor when you start it using --settings. These will be available on the server side only, unless wrapped under a "public" object of the root.
{
'public': {
'some-setting': 'some-value'
},
'other-setting': 'other-value'
}
That is a work around for dealing with no envrionmental variables. As the core email package always looks at the MAIL_URL environmental variable, you will probably need to send email through another service/provider.
Mandrill (by Mailchimp) have a sizeable free tier and will allow you to send transactional email. You can even make a mail template in mailchimp, export to HTML, import to mandrill and pass in merge variables in your API calls.
Better yet, there is a kick-ass package for writing to the Mandrill API. https://atmospherejs.com/wylio/mandrill
Hope that helps!
Elliott
but decided to answer my own question anyway.
I didnt and I cant set the C9 or my testing site env variable, so that s why.
The Meteor.startup(callback) method is executed at the end of Meteor initialization, but you are sending your email before the startup, so you should send it in the same block, after process.env.MAIL_URL..
You CAN set environmental variables using C9! You just pass it in when you run meteor.
BUT you can not send email using SMTP though on c9!
To make my life easier I just don't test my emails on c9 with Meteor.
If I absolutely need to I bypass the email function and use a custom emailer instead that sends using the MailGun REST API (NOT SMTP!!)
See Sending email using Gmail SMTP - Meteorjs
1 or 2% of users registering seem to get no confirmation email or they get a bad token appended to the confirmation link in the email. I can't determine why or where this wrong token comes from. It doesn't look like a truncated version of the correct one. It's totally different. Clicking it yields a 404 response.
I am not overriding the RegistrationController.
Could it be the mailer settings?
swiftmailer:
~
spool: { type: memory }
The only other changes I've made were in validation of a few custom fields.
registration:
form:
type: acme_user_registration
validation_groups: [MyRegistration]
confirmation:
enabled: true
Any ideas what's going on?
Thanks.
I found a problem while viewing a confirmation email in outlook.com. I turns out that outlook.com is 'previewing' the link to show some expanded metadata in the email message. This has the side effect of enabling the user and deleting the token. Once the user actually clicks the link, they get a token not found error, but their account is enabled.
In my Symfony2.1 application I'm using the SwiftMailer to send emails. Since I'm in dev mode, I'm not sending emails for reals. I control the output in the toolbar provided by the Profiler.
The email I'm sending is in HTML. So, to ensure HTML output I did the following settings:
$message = \Swift_Message::newInstance()
->setContentType("text/html")
->setSubject('Conferma registrazione nuovo utente')
->setFrom('xxx#xxx.com')
->setTo($email)
->setBody($this->renderView('AcmeMessageBundle:Contact:contact_request_email.html.twig', 'text/html');
$this->get('mailer')->send($message);
I suppose all the setting for HTML emails are ok. Notwithstanding that, I see that the emails sent are not shown as HTML in the Profiler dedicated area. In particular, all the HTML tags are escaped! Why? What am I missing in the settings?
For dev it is recommended to set up something like Gmail to deal with emails
# app/config/config_dev.yml
swiftmailer:
transport: gmail
username: your_gmail_username
password: your_gmail_password
As for HTML emails, I can't tell exactly what's your problem, it could be anything. HTML emails are not easy (it's like developing for IE6), that's why a lot of devs just choose to send text emails.