Forum Moderators: coopster
Host support said the following...
Please try using "localhost" or "2k3mail.example.com" as the mailserver instead of using "smtp.example2.com" or "mail.example2.com". You will have to change it where the mail action is generated from. When the email is set to send out, you must use either of those two mail servers. So make the changes necessary to your PHP mail action
Anybody know how to do this to my code? Thanks for the help. (I am an utter php neophyte as you probably can tell)
<?php
$sendTo = $_POST["email"];
$subject = "*** Corporate Car Pricing ***";
$headers = "From: CustomerService@example.com" . ">\r\n";
$headers .= "Reply-To: CustomerService@example.com" . "\n";
$headers .= "Return-path: CustomerService@example.com";
$message = "Congratulations ". $_POST["name"] . "! Pending final CCP Membership confirmation"; mail
($sendTo, $subject, $message, $headers);
?>
[edited by: ergophobe at 7:11 am (utc) on Mar. 21, 2005]
[edit reason] URLs exemplified as per Terms of Service [/edit]
Can you not just use the standard PHP mail function?
You can use explode to get the domain part of an e-mail address, so you split it and check if its the same as your domain.
$allowed = "yourdomain.com";
$email = "your@yourdomain.com";
$get_email = explode("@", $email);
if ($get_email[1]!= $allowed)
{
sorry, not valid
}
Something like that?
Or am I still half asleep?
dc
I know nothing about php... so if you suggest it I'm gonna try it.
Just so it's clear... the email addresses sent to this script will always be from outside the domain. I tried an email address inside the domain for diagnostic purposes only.
That said... what lines or code should I remove from my script (and replace with yours) ...or do I change to 'localhost' or '2k3mail.example.com' as advised by the site host? ..if so what code in my script do I change?
Thanks again - I owe you one!