E-mail activation not working with php mail

I have extracted the files to the following directory but I think it is wrong… C:\PHPMailer\PHPMailer-5.2-stable… should it just be under C:\PHPMailer?

You need to upload the files using FTP, not on your Local Disk (C:), but with the File Manager!

Yes but I am only up to step 2 of the following steps:

  1. Download PHPMailer: https://github.com/PHPMailer/PHPMailer/archive/5.2-stable.zip
  2. Extract the downloaded zip file on your computer.
  3. Rename the extracted folder to PHPMailer .
  4. Upload the extracted folder to your hosting account with an FTP client of your choice. As always, you should upload the folder to the htdocs folder for the domain you want to use the script on.

I guess it should be C:\PHPMailer?

On the folder where you downloaded the ZIP (e.g. C:\Users\user\Downloads\PHPMailer-5.2-stable.zip), but remove the PHPMailer-5.2-stable.zip on the final folder and then rename the extracted folder to PHPMailer.

Hello!

So just to clarify, my folder should be C:\PHPMailer and all the contents inside it? Therefore, I uploaded my folder to my cpanel at pianocourse101/htdocs/phpmailer correct?

I seem to be having problems using ftp to upload it… always says error but I can do it manually though…

Just to clarify, the folder should be where you downloaded PHPMailer zip. Then use FileZilla with those settings to upload the entire folder:
FTP server: 185.27.134.11
Port: 21
Connection type: Plain FTP (not secure)
Username: you can find it on the Client Area, with the description as “Website for yoursubdomain”, where yoursubdomain can be overwritten with the name you’ve chosen during the creation of the account.
Password: click on the username, then scroll down and click “Show/Hide” to show the password. Then copy it and paste it in FileZilla.
Connect and go to yourdomain/htdocs/ and upload the PHPMailer folder that you’ve renamed there.

Hello

I had saved the files to the following folder : image

Is that correct because in the past, I saved it in the wrong folder and it didn’t work…

Then upload the folder C:\PHPMailer to FTP with the settings listed on here.

thanks… I uploaded it manually and I think it is okay but now I need to set up my credentials…

Use the example provided on here but change smtp.gmail.com with smtp.office365.com, [email protected] with your Outlook/Hotmail email address and yourpassword with the password you use to login to the Microsoft account.

Can I leave it with gmail if I am using a gmail account?

Yes, but you need to enable Less Secure Apps from the Google account settings and disable the request for reCAPTCHAs by clicking here with the Google account you want to use.

I will try both method, including the Hotmail one but for this line of code: $mail->addAddress(‘$to’, ‘$first, $last’); // Set the recipient of the message.

Do I need the quotation mark if I am using variables?

You must not need the “quotation marks” you called if you’re using variables. You would define them on your code by using this example: $exampleVariable = "test123";, where exampleVariable is the name of the variable that you can change and “test123” is the value (can be a boolean, a string or a integer).

I can’t get either my gmail or Hotmail to work with my credentials: I have put asterix in my password to hide it:

// Edit this path if PHPMailer is in a different location.

require ‘./PHPMailer/PHPMailerAutoload.php’;

$mail = new PHPMailer;

$mail->isSMTP();

/*

  • Server Configuration

*/

$mail->Host = ‘smtp.gmail.com’; // Which SMTP server to use.

$mail->Port = 587; // Which port to use, 587 is the default port for TLS security.

$mail->SMTPSecure = ‘tls’; // Which security method to use. TLS is most secure.

$mail->SMTPAuth = true; // Whether you need to login. This is almost always required.

$mail->Username = “[email protected]”; // Your Gmail address.

$mail->Password = “**********”; // Your Gmail login password or App Specific Password.

/*

  • Message Configuration

*/

$mail->setFrom(‘[email protected]’, ‘Awesome Website’); // Set the sender of the message.

$mail->addAddress($to, $first, $last); // Set the recipient of the message.

$mail->Subject = ‘PHPMailer GMail SMTP test’; // The subject of the message.

/*

  • Message Content - Choose simple text or HTML email

*/

// Choose to send either a simple text email…

$mail->Body = ‘This is a plain-text message body’; // Set a plain text body.

// … or send an email with HTML.

//$mail->msgHTML(file_get_contents(‘contents.html’));

// Optional when using HTML: Set an alternative plain text message for email clients who prefer that.

//$mail->AltBody = ‘This is a plain-text message body’;

// Optional: attach a file

$mail->addAttachment(‘images/phpmailer_mini.png’);

if ($mail->send()) {

echo “Your message was sent successfully!”;

} else {

echo "Mailer Error: " . $mail->ErrorInfo;

}
The variables are taken from my registration page… I think the mail function should work but do you guys have any rules in using mail? Maybe I didn’t set up something correctly?

This is very peculiar indeed because I got my email to be saved in a text file but just won’t show up in my actual inbox message… I think this could be some kind of security setting on your end… so the mail function is working

-==Multipart_Boundary_x913a411a0db3977c2c637ce60e6d5487x
Content-Type: text/html; charset=“UTF-8”
Content-Transfer-Encoding: 7bit

Activate your Primer Level Membership Plan!

Dear Mervin Lee,
Thank you for registering your Primer Level Membership Plan with PianoCourse101! You are receiving this e-mail because you or someone else claiming to be you has selected a Primer Level Membership Plan

If you believe that this is a mistake, please send us a ticket with the subject “How to cancel my Primer Level Membership Plan?” and allow at least 48 hours before receiving a reply.

However, if this is correct, then you must activate your Primer Level Membership Plan by clicking on the link below:

<a href=https://www.pianocourse101.com/[email protected]&activatetoken=cqffqcaqbR>Click here to activate your Primer Level Membership Plan.

Alternatively, you can use the following token to manually activate your Level 3 Yearly Membership Plan by clicking on the ‘Activate Membership\s Section:’

Token:.cqffqcaqbR;

This is a weird problem

I actually don’t have ssl enabled yet, will this affect my phpmailer and mail function? I am waiting for cloudfair to be activated…I tried it with hotmail but still can’t get it to work…

SSL doesn’t affect PHPMailer and mail() functions on InfinityFree; they remain all the same. Cloudflare acts as a DNS manager, SSL issuer and a reverse proxy that needs that the IP is online in order to do this.

It is still weird that my files are saving into my text file but not displaying them

Is the error log working? Will it display any errors there?