Hey everyone,

I was doing a search on good tutorials on how to use the mail function. I thought it would be as easy as what PHP api tells me how to use it. I stored the value of mail() in a variable if the variable is true then I will get a message saying "success". Otherwise, a "fail" message will be given.

I get the success message displayed and get a warning as well about the port 25 and smtp.gmail.com. I suppose since it is just a warning, it isn't going to affect anything because the value of mail() is true which means it successfuly gets through. But unfortunately, I don't receive any Email.

Does anyone know how to send Emails using localhost and Gmail account without installing any Mail Client? or Just sending dummy emails?

Cheers,

Recommended Answers

All 3 Replies

If its just your computer or you are in network
You must know ip/domain name of SMTP server in your network

open php.ini file

[mail function]
SMTP = xxx.xxx.xxx.xxx (YOUR smtp ip like)
smtp_port = 25

now your php ini should look like this somewhere

restrat apache service

echo mail (......);

on success it will return 1 else nothing, if success you will receive mail within few seconds

For some reason, the mail function isn't working.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.