简体   繁体   中英

How to set port and host for php function mail()

I have set up a website at online domain, and the php mail() function is not working. The technician tells me i have to set the port = 2525 and host = mailout.one.com. Can someone tells me how to set the right port and host?

i'm not using xampp, thus php.ini does not exist

Thanks.

You can set it at runtime for testing. But if it works you'll want modify your php.ini file.
Put this at the top of your mailer script to test.

ini_set('SMTP','mailout.one.com' );
ini_set('smtp_port',2525);

To change it in your php.ini, you can just search for 'SMTP' or 'smtp_port'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM