Mail not sending

Status
Not open for further replies.

ChrisWebDesign

New Member
Messages
5
Reaction score
0
Points
1
So I have set up an account feature for my website and when users create their accounts they are sent an activation e-mail.

The mail will not send if the message contains a url that includes a subdomain. This means I cannot get a working activation link.

For Example - This will send:

PHP:
<?php
$username = 'Admin';
$email = 'email@email.com';
$emailHash = 'test';

$to = 'useremail@email.com';
$subject = 'Account Activation';
$message = '
Thank you for creating an account!

Your account has been created and your username is listed below. To login, please activate your account by clicking the link below.

------------------------
Username: ' . $username . '
------------------------

Please click this link to activate your account:

http://mywebsitex10hostcom/Website/verify.php?email=' . $email . '&emailHash=' . $emailHash . '
';
       
$headers .= 'From: website@mywebsite.x10host.com' . "\r\n";
mail($to, $subject, $message, $headers);
?>

However... This will not send:

PHP:
<?php
$username = 'Admin';
$email = 'email@email.com';
$emailHash = 'test';

$to = 'useremail@email.com';
$subject = 'Account Activation';
$message = '
Thank you for creating an account!

Your account has been created and your username is listed below. To login, please activate your account by clicking the link below.

------------------------
Username: ' . $username . '
------------------------

Please click this link to activate your account:

http://mywebsite.x10host.com/Website/verify.php?email=' . $email . '&emailHash=' . $emailHash . '
';
       
$headers .= 'From: website@mywebsite.x10host.com' . "\r\n";
mail($to, $subject, $message, $headers);
?>

As you can see the only difference is that the second set of code includes 2 . (dots) for the x10host subdomain. But this also results in a url that will not load in the browser because its an incorrect url.
 
Status
Not open for further replies.
Top