Can I send mail without SMTP settings?

Without SMTP settings like Host, Username and Password, I have to send mail. Is this possible in PHP or any other languages?

+4
source share
1 answer

Yes, this can be done using the mail () function. However, consider the following limitations:

Note. . The mail implementation () differs from many Unix implementations. Firstly, it does not use local binary code for composing messages, but it works only on direct sockets, which means MTA needs to be listened to on a network socket (which can either be on localhost or a remote machine). Secondly, custom headers like From :, Cc :, Bcc: and date: are not interpreted by the MTA, primarily, but are parsed by PHP. Therefore, the to parameter should not be an address in the form of "Something." The mail team cannot properly understand while talking to the MTA.

Note: It is worth noting that the mail () function is not suitable for large volumes of email in a loop. This function opens and closes the SMTP socket for each message, which is not very efficient.

+1
source

All Articles