grogers Posted November 11, 2010 Share Posted November 11, 2010 I'm guessing this is more of a hosting/mail question than specifically php, but here goes... I have this very basic code to send a test email: <?php $to = '[email protected]'; $subject = 'Test email'; $message = "Hello World!"; $mail_sent = mail( $to, $subject, $message); echo $mail_sent ? "Mail sent" : "Mail failed"; ?> and the following in my php5.ini: [mail function] SMTP = relay-hosting.secureserver.net sendmail_from = [email protected] When the mail is received, it's showing as coming from "[email protected]". How can I get this to show as something more reasonable and related to my domain? Ideally something more like [email protected]. Thanks in advance! Greg Link to comment https://forums.phpfreaks.com/topic/218431-basic-mail-question/ Share on other sites More sharing options...
ManiacDan Posted November 11, 2010 Share Posted November 11, 2010 The next argument to the mail() function are the email's headers, which contain FROM and REPLY-TO. -Dan Link to comment https://forums.phpfreaks.com/topic/218431-basic-mail-question/#findComment-1133191 Share on other sites More sharing options...
Rifts Posted November 11, 2010 Share Posted November 11, 2010 http://www.htmlite.com/php029.php should help Link to comment https://forums.phpfreaks.com/topic/218431-basic-mail-question/#findComment-1133208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.