trying to use the email subscribe form, it seems ok to add an email, however i never receive it in my email box, tried different emails addresses, but can’t receive can someone help me with the php code (code below)?
<?php
function isValidEmail( $email = null ) { return preg_match( ”/^ [\d\w\/+!=#|$? {^x%x }`’~-]
[A-Z0-9]
$email ); }
/ Check if email has been posted / if ( isset($_POST[‘email’]) ) {
/ Validate email /
if ( isValidEmail($_POST['email']) ) {
/ Send mail notification */
$to = 'robertb1972@hotmail.com'; // Your e-mail
$subject = 'New subscriber';
$message = 'Hi, you have one new subscriber. This is his/her e-mail address: ' . $_POST['email'] . '.';
$headers = "From:" . $_POST['email'];
mail($to,$subject,$message,$headers);
echo 'successful';
} else {
echo 'invalid_email';
}
}
Have you checked your spam?
BenSheppard said
Have you checked your spam?
yes, no message
Edit
Never mind, i thought it’s a WP theme, just noticed it’s HTML template.
So what does it return, “successful” or “invalid_email”?
i just found the problem my hosting service asks that the sender email should be from the same domain
