Include user and password

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CanMikeF1
Forum Newbie
Posts: 8
Joined: Wed Feb 18, 2009 7:32 am

Include user and password

Post by CanMikeF1 »

Got the nasty 'SMTP server response: 530 authentication required' when attempting to use the mail command in PHP. Works fine on my Unix box but obviously I need to send my username and password attached to my email server supplied my ISP.

So if my mail command is:

mail ('to-email-address', 'subject' ,'body of text' , 'from email address')'; where do I add my user/password?

My php.ini file is good, my SMTP = points of my server and smtp_port = 25.

Now, if I could only supply my user/password it would work.

Mike in Toronto
Randwulf
Forum Commoner
Posts: 63
Joined: Wed Jan 07, 2009 7:07 am

Re: Include user and password

Post by Randwulf »

I don't think you can solve that problem with PHP. You'll need to solve it on the SMTP server by allowing PHP to send mail.
CanMikeF1
Forum Newbie
Posts: 8
Joined: Wed Feb 18, 2009 7:32 am

Re: Include user and password

Post by CanMikeF1 »

So how do you do that?
Randwulf
Forum Commoner
Posts: 63
Joined: Wed Jan 07, 2009 7:07 am

Re: Include user and password

Post by Randwulf »

You'll need to talk to your host on that one. It depends on what sort of server they're running and what sort of security they have in place.
CanMikeF1
Forum Newbie
Posts: 8
Joined: Wed Feb 18, 2009 7:32 am

Re: Include user and password

Post by CanMikeF1 »

Found a work-around. It's a small piece of software that creates a .bat file and then runs email through the command line, passing username and password.

It works, it's kludgy but it does the job. For testing code on my window (vista) OS, it's OK.

Thanks for the advice.
Post Reply