|
I use sendmail in my PELR scripts to send emails to subscribers. The subscribers get the email with the FROM field as username@servername.host.com, where username is my actual user id on the server servername.host.com. I'd like sendmail to show FROM field as, for example, newsletter@mydomain.com. How do I do that? which conf files would i need to modify? Note: I use sendmail in my PERL scripts with the flags -t -i
How do i get sendmail to show the FROM field as the domain name, not the server name?
I believe the following thread conversation will help you address this problem. Which config files you change depend a bit on your setup but this link should help you out in either case.
Enjoy!
How do i get sendmail to show the FROM field as the domain name, not the server name?
I used this script in php. I might help you understanding
<?php
$sendername = $_POST['sendername'];
$friend = $_POST['sendtoname'];
$to = $_POST['sendtoemail'];
$from = $sendername."<info@yourwebsite.com>";
$subject = $friend.", I have something to say";
$body = "Hi,\n\nHow are you?".$friend;
$xHeaders = "From: $from\nX-Mailer: PHP/" . phpversion();
if (mail($to, $subject, $body, $xHeaders)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
cheers
|