0

I'm trying to put a smtp in a source of php. Today SMTP is coming with a different domain name, so i'm trying to change the name of the smtp using(init_set) this below:

today is: hw102.test.com.br (example)

i need to change to: mail.mydomain.com

ini_set ("SMTP", "mail.mydomain.com.br");

but not work.

When it arrives in my email comes with smtp "hw102.test.com.br". I want to come with this smtp "mail.mydomain.com.br".

I need to change something in php.ini too?

Anybody here can help me?

André
  • 25
  • 1
  • 7
  • What operating system are you running php on? – elitechief21 Mar 21 '14 at 13:05
  • The `SMTP` directive is only used on windows systems. I would recommend using PHPMailer. See this [SO](http://stackoverflow.com/questions/11942896/use-default-php-mail-function-with-smtp-server-on-linux) for more information. – elitechief21 Mar 21 '14 at 13:09
  • There's no way then use ini_set on my php page on linux right? I have to redo my code, is this? – André Mar 21 '14 at 13:15
  • Usually linux servers, by default, have an smtp server installed with the `sendmail` command so trying to set an smtp server on linux is unnecessary. I'm not sure I understand what you are trying to accomplish. Do you want the `from` domain to be `mail.domain.com.br`? If so you can set this but by modifying the `sendmail_path` directive to something like `/usr/sbin/sendmail -t -i -fusername@mail.mydomain.com.br -Fusername`. – elitechief21 Mar 21 '14 at 14:07
  • Though you won't be able to set this directive using `ini_set`, as it can only be set in `php.ini` or `httpd.conf` – elitechief21 Mar 21 '14 at 14:09
  • I want change this: mailed-by: hw102.test.com.br its a smpt who sended. – André Mar 21 '14 at 23:25

0 Answers0