how to send email in wordpress not using plugin - wordpress

I am new developer in wordpress. I wanna send email not using plugin . i use function wp_mail as shown below:
wp_mail('myname#yahoo.com', 'subject', 'message', $headers);
when i use yahoo email myname#yahoo.com i can send 'subject,messege' to my yahoo account. but when i use gmail email xxx#gmail.com i can't send 'subject,messege' to my gmail account.why can not send with gmail account? pleas help me !

As you have problem with only Gmail we can infer that it is not the problem with 'sending' but with 'receiving'. Something is blocking your mail at the receiving end. Following things can be done to ensure better receiption.
Use a real address. Dafult is wordpress#yourdomain.com. This can be filtered with wp_mail_from.
Use SMTP to send email. You can do this with phpmailer_init action.
Disable headers.
Contact hosting providers and confirm that your server is not blacklisted by Gmail.

If you used wp_mail to send your message, without a plugin, this means you didn't use Google's SMTP server. And you're wondering why you didn't receive it at your gmail account? Because you basically forged your from address. Of course Google rejected your email.
The only way to get that to work is to use authentication when sending your mail. That means connecting to the smtp.gmail.com server and in 2015 that means using OAuth 2.0 unless you want to deal with another can of worms.
Check out Postman SMTP for sending mail in WordPress.
Here's some reading for you to do: http://googleappsdeveloper.blogspot.no/2014/10/updates-on-authentication-for-gmail.html

Related

How to send message directly to inbox (gmail) from localhost?

I'm trying to send the message using the contact form on local-host. However, I'm able to send it to my mail address, but it goes to the spam folder!
I used the SendGrid plugin and integrate it with the Contact form 7.
Expected: Message send to the main folder in Gmail address.
Actual Result: Message goes to the spam folder.
You can use GMAIL SMTP Plugin. You need to just install the plugin and then get a GMAIL API and SECRET KEY. Put that into your plugin.
for more check this post with video.
http://www.onlinemoneyidea.cf/2019/06/gmail-smtp.html

Firebase Authentication: Emails sent but not received on special email addresses such as *#gmx.at

I am using Firebase Authentication in my Ionic App. Some users have reported to not receive the verification email which is sent after a user signs up, or when the resendVerificationEmail is triggered.
This works fine for email providers like #gmail.com or #live.de, but for those other users with special providers like #gmx.at it's not working. The emails are sent successfully according to firebase but they are never received.
Possibly the emails get filtered?
Has anyone else ran into this problem? The message template can not be modified but would using a custom SMTP server possibly help?
The problem is solved by using my own private SMTP server for sending the Authentication emails.
I am using a hosting service for my domain that comes with email service so I am using that one. Using other services such as Mailgun or Mailjet etc. might also solve the problem.
You can set up your custom SMTP server right in the firebase console under Authentication/Templates.
I had the same problem with others emails providers (orange.fr sfr.fr free.fr ...). After deeper analysis, it appeared that it is the domain address inside the (generated) link that is detected as SPAM by emails providers (maybe everything that sounds like *.firebaseapp.com)
https://your-subdomain.firebaseapp.com/__/auth/action...
I changed it to a custom one of mine (through Authentication->templates->"Customize action URL" (bottom right)):
https://www.my-custom-domain.com/__/auth/action
and no more problem!
Some doc (note on blue background):
https://firebase.google.com/docs/auth/custom-email-handler?hl=en&authuser=0#link_to_your_custom_handler_in_your_email_templates

Contact Form 7 showing sent message but not receiving email

Experiencing issue with WP plugin, contact form 7. When I fill in the form and submit, I receive a success message stating it was sent yet I don't receive it in my emails.
The mail is not in my junk and I only received the message in my email when I input the email its being send to!?
The email it is going to is an exchange account. I can see the emails coming through using a contact form submission on the WP backend. But would like to resolve this issue.
Form
[text* your-name placeholder "Name"]
[email* your-email placeholder "Email Address"]
[text* your-dob placeholder "DOB"]
<p>Which Challenge(s) would you like to enter?</p>
[checkbox* select-challenge "1" "2" "3"]
</br>
Please tick here that you have read and accepted the [popup_trigger
classes="popmake-food-challenge-tcs"]
<u>terms & conditions</u>[/popup_trigger] for entry & participation.
[acceptance acceptance-997]
[submit "Send"]
Mail
To: myname#company.com
From: Website
Subject: Challenge
Reply-To: [your-email]
From: [your-name] <[your-email]>
Eating Challenge Registration
Name: [your-name]
Email: [your-email]
DOB: [your-dob]
Challenge(s): [select-challenge]
I also checked with website host that they use wp_mail() and was confirmed they do. As other contact forms send - bar this one.
Try setting the from: email address to wordpress#yourdomain.com. Contact Form 7 support recommends setting the from address as being on your own domain, so that the website's mailer program doesn't think it is spoofing the email being sent (sending it from an incorrect email address).
If that doesn't work, best to use a plugin like WP Mail SMTP Plugin.
I set it up to send contact form emails through our Gmail account, which worked well. Instructions here.
SMTP Plugins are a Band-aid Solution
The reason people use SMTP plugins is because they have not set up their own domains properly; so, they route their emails through their email hosting company under the expectation that THEIR domain is both set up properly and permissive enough to accept the email that needs to be forwarded. So, let's say your website is at example#mywebsite.com and your email is example#gmail.com, then you can use an SMTP plugin to send an email to gmail.com, and then gmail resends it on your behalf.
As you can see, this is a clunky work around, and does not actually fix the problem of not being able to send email from your website directly. There are a few use cases where this is a problem:
If you want to actually send the email from example#mywebsite.com and not expose your example#gmail.com address to the public.
If your email provider does not support SMTP.
Some anti-spam tools may block emails routed this way, because SMTP can be a sign of spoofing through a hacked account. This almost always leads to problems when using the Mail(2) feature to send confirmation emails to the client since you are pretty much guaranteed that some of them will use spam filters that will block it.
You may also need to send emails through other means (not contact form 7) that does not work with your SMTP plugin.
A Better Solution
The best way to fix deliverability issues to to set up your DKIM, SPF, and PTR records properly in your DNS.
If you are using cPanel as most hosting companies seem to do these days, you need to go to EMAIL > Email Deliverability and it will show you warnings if you need to update your DNS. If you do, just copy the records it auto generates into your Domain's DNS and this should fix the problem. Unlike trying to route through someone else's server to send emails, this will set up YOUR server to send them properly thus alleviating all of the above mentioned issues.
This is just as easy to set up as most SMTP plugins, and makes it so you don't have to clutter your WordPress install with unnecessary plugins.
If you do not have cPanel access, just contact your Domain Hosting provider and ask that they setup your DKIM, SPF, and PTR. If your Domain Hosting provider and your Web Hosting provider are two different companies, you may need to request the proper DNS records from your web hosting company to either put in your self or give to your domain hosting company.
when I have a problem about wp contact form I always solve that with using smtp plugin. I suggest you to use wp smtp mail plugin.
Easy SMTP WP plugin page on wordpress.org
If any problem after using smtp plugin, reply this post I will try to help you again.
I have this problem in my website.
Some hosting companies block automatic email sending, because some user uses the host for sending email marketing. So, I think you can contact your host provider to solve this problem.

Gmail cannot receive wordpress email

I trying to send email to my gmail, but I cannot see the email in my gmail. I also tried to send the email to my hotmail, it is working when send to hotmail.
How do I fix this problem?
Thanks
Today, email service providers are very string with spam. I think your mail that you sended with wordpress is in your Gmail spam folder. You're maybe sending it from localhost or something like that. So Gmail put it by default to the spam folder. You can recover that by mapping a public domain name on your smtp server or like #raman-kuman's answer, you can use a plugin like Postman SMTP plugin to configure an email service like Gmail or Hotmail. If you use another famous email service, you can maybe find the settings here.
I would highly recommend you to use a personal mail server, so you can personalize your email like:
no-reply#my-awesome-domain.name for a notification
contact#my-awesome-domain.name for contact
...
It's looks better than my-awesome-company#gmail.com.
It's most likely to do with :
1.) Your SMTP relaying settings within Wordpress. Check how it's configured and post a new question if you're struggling to get them to work. If your using a SMTP relay service then confirm these credentials are correct.
2.) The email address you are sending out as. If your sending as GMAIL or Hotmail e.g. administrator#hotmail.com from Wordpress using the PHP to send mail then it maybe be sending the mail from the IP address of your webserver which will not be part of the Hotmail/Gmails SPF record so recipient servers would block you on connection.
Make sure your email address that is sending from WordPress is the same as your domain name - something like wordpress#yourwebsite.com, otherwise use the Postman plugin, it will take a bit of configuration but you will be able to send to anywhere.
You can use Gmail's SMTP using Postman SMTP plugin, it works for all..

Wordpress Contact form - Gmail issue

I am using Contact Form 7 on wordpress. When using any other email account apart form my gmail account in the to: address(where users send their queries to), I get the emails. just not gmail that is not receiving my form emails...
Why is that?
I am just using that plugin and no other mail/smtp plugins...
Any ideas?
.. just not gmail that is not receiving my form emails... Why is that?
Because Gmail refuses to accept an email destined for a Gmail user, claiming to be from a Gmail user, delivered without authentication. That is, delivered through a server other than smtp.gmail.com.
It's Spam rules are (correctly) denying your 'forged' sender address.
When using any other email account apart form my gmail account [...] I
get the emails
Obviously accounts that aren't Gmail have no way of verifying if the Gmail address is the true sender, so they have no grounds to reject the email.
You HAVE to use an SMTP plugin: https://wordpress.org/plugins/postman-smtp/

Resources