views:

57

answers:

2

I am using godaddy hosting account with windows hosting. Using PHP I am sending email to customers, how do I use my own email address instead of [email protected]

I would like to use [email protected] for all my out going mails and reply to as well. I did by setting a from header in the PHP headers, but its not working.

Any help is appreciated...

Thanks Vasu

A: 

You'll probably need PHPMailer or similar for SMTP.

Also, find a new web host if you can. GoDaddy is garbage.

Lotus Notes
+1  A: 

If you're using the php mail() function, you don't want to send headers(), rather you need to pass the headers as an argument to the function:

From the manual for mail():

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

And this example (also from the manual):

<?php
  $to      = '[email protected]';
  $subject = 'the subject';
  $message = 'hello';
  $headers = 'From: [email protected]' . "\r\n" .
      'Reply-To: [email protected]' . "\r\n" .
      'X-Mailer: PHP/' . phpversion();

  mail($to, $subject, $message, $headers);
  ?>
Tim Lytle
thanks for the answer, I am exactly doing the same, but still I am getting all the mails from [email protected]
Vasu