Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,817 members, 7,820,882 topics. Date: Wednesday, 08 May 2024 at 12:36 AM

Need Help In Sending Mail From My Website - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Need Help In Sending Mail From My Website (1510 Views)

Please Help! My Website Can't Load More Than The Homepage / How Do I Add The Google Adsense Code To My Website? / How Do I Get My Website Secured Using Https (2) (3) (4)

(1) (Reply) (Go Down)

Need Help In Sending Mail From My Website by Ayemileto(m): 9:27pm On Jan 07, 2018
Hi webmasters.
I just launched a website that allows people to signup an get verification mail to verify their account.

During testing, I noticed mails don't get delivered to Gmail but delivering successfully to yahoo mail.

I contacted my host and was told to use an stmp server.

I actually coded the website from scratch and its my first.

As per suggestion from my host, I installed WordPress and installed WP-mail after.

Now am stuck at choosing STMP. Most of the STMP server I saw online offer for bulk messages (like to an email list) which is not what I don't seen to understand the API stuff most.

Please I need suggestions on mail servers to use.

Also I need some explanations on setup and how api works.

I'm also thinking if there's any other way to go about things without installing WordPress? (I don't fancy the way unused files are on my website.)
Re: Need Help In Sending Mail From My Website by yomalex(m): 5:12am On Jan 08, 2018
if you are not sending too much emails use gmail as smtp
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 6:35am On Jan 08, 2018
yomalex:
if you are not sending too much emails use gmail as smtp
yomalex:
if you are not sending too much emails use gmail as smtp


Like how many mails can I send per day and how do I set it up?
Re: Need Help In Sending Mail From My Website by yomalex(m): 7:20am On Jan 08, 2018
Ayemileto:



Like how many mails can I send per day and how do I set it up?

I really do not know how much you can send with it.

SMTP Server:smtp.gmail.com
Port:587
Username: gmail username
Password: gmail password
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 8:11am On Jan 08, 2018
ive configured gmail with wp mail.but emails sent from wihin the website are not getting delivered but those sent from within wordpress are. wordpress and my site files are in the same folder.
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 9:10am On Jan 08, 2018
yomalex:


I really do not know how much you can send with it.

SMTP Server:smtp.gmail.com
Port:587
Username: gmail username
Password: gmail password


Can I put this in my php config file instead of using wp-mail? Thanks.
Re: Need Help In Sending Mail From My Website by HostDocHosting: 11:26am On Jan 08, 2018
hi.
I would like to help but with such limited info and without seeing your code, I cant help much. If you can share your page code, I could have a look for you or a link to the site.
In any case, have you tried implementing Mailchimp?
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 12:53pm On Jan 08, 2018
HostDocHosting:
hi.
I would like to help but with such limited info and without seeing your code, I cant help much. If you can share your page code, I could have a look for you or a link to the site.
In any case, have you tried implementing Mailchimp?

No.

the problem i'm having is email not delievering to Gmail. To solve this i want to use an external STMP. i've decided to use Gmail as suggested above(for testing). but i'm confused about configuring mail() function to use external service.

someone told me to use phpmailer. but i don't really get how to go about it.
Re: Need Help In Sending Mail From My Website by Bolaji21(m): 10:27pm On Jan 08, 2018
Ayemileto:


No.

the problem i'm having is email not delievering to Gmail. To solve this i want to use an external STMP. i've decided to use Gmail as suggested above(for testing). but i'm confused about configuring mail() function to use external service.

someone told me to use phpmailer. but i don't really get how to go about it.
In your cpanel, create an easily say noreply@yourwebsite.com
Them download phpmailer and use it to send mails.
In the configurwtion, use isSMTP()
Of course, after downloading phpmailer, there's a folder called examples. There you'ull see examples of how to use phpmailer to send emails.
It should be easy to grasp if you've been doing php for 6 months.
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 1:54pm On Jan 09, 2018
Bolaji21:

In your cpanel, create an easily say noreply@yourwebsite.com
Them download phpmailer and use it to send mails.
In the configurwtion, use isSMTP()
Of course, after downloading phpmailer, there's a folder called examples. There you'ull see examples of how to use phpmailer to send emails.
It should be easy to grasp if you've been doing php for 6 months.

Actuall i'm new to PHP and this is my first application. but i can follow examples.

Here's the error i'm getting now.

i got this same error after configuring PHPmailer. i actually thought i didn't get it right and uninstalled PHPMAILER. i installed another mail library an got same error.

could not connect to the host "smtp.mail.yahoo.com":

same applies to Gmail. i contacted my host and they said port 25, 465, and 587 are all available. so i'm still trying to get the stuff.

they actually suggest i code a mailer myself(since i wrote the code instead of using a CMS) or use wordpress so they can help me configure it.
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 1:58pm On Jan 09, 2018
i'm hiding services that depend on mail already(actually changing them to comments) pending the time i find a solution.

that means users won't verify their mail after signup and they wont be able to change password.
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 3:04pm On Jan 09, 2018
when i set use ssl to false, i have a new error.

Connected to SMTP server "smtp.gmail.com". Erro ocurred: it was not possible to read line from the SMTP server

it connected? i think.

who understand the rest?
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 3:07pm On Jan 09, 2018
the same error occurred for yahoo too.
Re: Need Help In Sending Mail From My Website by Bolaji21(m): 5:46pm On Jan 09, 2018
Ayemileto:


Actuall i'm new to PHP and this is my first application. but i can follow examples.

Here's the error i'm getting now.

i got this same error after configuring PHPmailer. i actually thought i didn't get it right and uninstalled PHPMAILER. i installed another mail library an got same error.

could not connect to the host "smtp.mail.yahoo.com":

same applies to Gmail. i contacted my host and they said port 25, 465, and 587 are all available. so i'm still trying to get the stuff.

they actually suggest i code a mailer myself(since i wrote the code instead of using a CMS) or use wordpress so they can help me configure it.
In my suggestion, I specifically requested that you use your server stmp. If your domain name is mywebsite.com, then use mail.mywebsite.com

Let me show you the code. Just copy, paste and modify as appropriate


require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = "mail.mywebsite.com";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 25;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "yourname@mywebsite.com";
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 9:22pm On Jan 09, 2018
Bolaji21:

In my suggestion, I specifically requested that you use your server stmp. If your domain name is mywebsite.com, then use mail.mywebsite.com

Let me show you the code. Just copy, paste and modify as appropriate


require '../PHPMailerAutoload.php';

//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = "mail.mywebsite.com";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 25;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "yourname@mywebsite.com";
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');

//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}


Thanks. I will try this.

I guess I will place phpmailer outside the folder requiring the code?
.
Re: Need Help In Sending Mail From My Website by Ayemileto(m): 9:38pm On Jan 09, 2018
Username and password will be my hosting login details right?
Re: Need Help In Sending Mail From My Website by bedfordng(m): 10:05am On Jan 10, 2018
Ayemileto:
ive configured gmail with wp mail.but emails sent from wihin the website are not getting delivered but those sent from within wordpress are. wordpress and my site files are in the same folder.
I can set this up for you.on WordPress to send mails but not free though .
Re: Need Help In Sending Mail From My Website by Bolaji21(m): 1:54pm On Jan 10, 2018
Ayemileto:



Thanks. I will try this.

I guess I will place phpmailer outside the folder requiring the code?
.
Yes please

(1) (Reply)

Webmasters Please Review My Website To Know If I'm Good To Apply For Adsense / Top Searched Keyword On Search Engine / Add More Than One Gadget On Top Of Blog's Header.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 37
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.