PHP mailer example - Webshop Pro

In order to use mail in PHP, authenticated smtp is required just like outlook. To get this done you need to use a bit more code than usual. We have put this code in a file for you so you can use the mailTo function instead of the mail function. Otherwise it works the same.

To use this function you need an email address which you can create in the control panel. Remember the password you created with it, you will need this too. More information can be found here: https://www.mijnhostingpartner.nl/client/knowledgebase/98/Hoe-maak-ik-een-email-adres-aan.html

The code can be found under the following link:
https://phpmailer.worxware.com/index.php?pg=examplebsmtp

Use this code as follows:

Upload the folder mailer to the wwwroot of your domain.

Then add the following code at the top of the php code from which you want to mail:


$user = "voorbeeld@mijnhostingpartner.nl"; // Enter your own address here
$pass = "example"; // And here the password that goes with it
include("mailer/mhpMail.php"); /* If the php file is not located in the wwwroot but 1 level deeper then add a / in front of it: "/mailer/mhpMail.php" */
?>

Next, change the mail function in the php file to mailTo. Otherwise it can be used in the same way.


As for webstore pro, there are a few files that need to be changed:

index.php
formm.class.php
newsletter.class.php
pwishlist.class.php
simplewishlist.class.php

Let's start with the index.php. Here you will find quite at the beginning the following 2 lines:

ini_set('display_errors',0);
error_reporting(0);

Immediately below this, the following lines should be added. Modify them as described earlier in this article.

$user = "voorbeeld@mijnhostingpartner.nl";
$pass = "example";
include(
"mailer/mhpMail.php");

The above lines should also be added to the top of the asinum.php file.

Next, the 2 mail functions within the index.php file should be changed to mailTo. These can be found approximately on line 684, this may vary a bit, but they look like this.
mail($customeremail,$thesubject,$mail,$headers . $headerscustomer);
mail($shopowneremail,$thesubject,$mail,$headers . $headersowner);

So this should become:
mailTo($customeremail,$thesubject,$mail,$headers . $headerscustomer);
mailTo($shopowneremail,$thesubject,$mail,$headers . $headersowner);

Furthermore, on line 977 you will find the following line:

mail($userdata['email'],$thesubject,$mail,$headers);

This then becomes:

mailTo($userdata['email'],$thesubject,$mail,$headers);

The same should be done in the remaining files. The functions can be found for each file on the following lines (so this may vary a bit, but won't be off by much)

File framework/formm.class.php:
line: 42

File framework/newsletter.class.php:
line: 51

File framework/pwishlist.class.php
line: 104

File framework/simplewishlist.class.php
line: 185

These were the files that need to be changed. When this is done the sending of mail should work properly.

keywords: SEOshop seoshop seo shop block sender SMTP AUTH 550 smtp mailer example phpmailer php mail