localhost mailer logs me into POP an stil refuses SMTP
This isnt a security app but falls into networking.
I have a bit of a delma here I was woundering if I can get some guidence. For a discusion form I am makeing, a visitor who applys to join will recieve either an aproval or denal message in email simular to what hapens here at antionline. The script is complete except for the mail part of it. I can mail to a local address like journy101@localhost but not external without POP auth which si normal and what I want to prevent spammers. However to send my mails to an exteral as needed by my particular application I would need to loging to POP first with USER PASS then conect to 25 and issue my SMTP commands. Is this corect?
When I do this my mail server acepts my username and password, and reponds with +OK mailbox locked and ready. That indicates my POP has loged me in. But now when I try to send my mail is when I get user not local:
mail($to,$message,$subject,$headers);
This is when I get my 550 user not local, previous to issueing the mail command I create and open a socket conection to localhost on port 110, I issue my USER and PASS to get logged in. Would this be the corect way of doing this? If instead of mail I open a second socket conection to 25 and issue SMTP same thing hapens user not local.
Mail relay is set to enable on the condition the user logs into POP first, then SMTP as a requirement for authentication so spammers dont bounce messages off my server.
I am stumpted with this. I have downloaded a bunch of code examples, searched google. asked questions on various message boards.
If i set the from as a local address and to as the external same thing. but if i set to as a local then it is aproved and acepted for delevery. I think this is normal because you need POP AUTH fiorst, but in my case Ive already logged into POP. So I should be able to send my SMTP?
Can someone please give me some guidence?