sending mail

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
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

sending mail

Post by dull1554 »

i know that to use the

Code: Select all

mail();
command you have to have sendmail or a pop3 mail server running, i was wondering if it is possiable to send mail without sendmail on one's server?
User avatar
uberpolak
Forum Contributor
Posts: 261
Joined: Thu Jan 02, 2003 10:37 am
Location: Next to the bar

Post by uberpolak »

You don't need sendmail per se, but an smtp server has to be running.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

aye, check out this link for more information :

http://www.php.net/mail
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

What about if you're using a Win32 server, and you don't have an SMTP server running locally? Is there like may be a sendmail or like binary that one could use? Or can you use somebody else's mail server, like is there may be some mail servers out there that allow other people to use the smtp (relaying i think its called?)?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

I have a smtp server elsewhere that I can use with phpBB just fine. I have to login though, and phpBB can handle that. But for the rest of my site, where in php.ini can I put the user/pass for my remote smtp server?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

I don't think an SMTP server is needed locally. Rather just the address of an working SMTP server in your php.ini.

I certainly don't have one locally, and it's working fine.
Here's a short explanation of the configuration directives.



SMTP string
Used under Windows only: DNS name or IP address of the SMTP server PHP should use for mail sent with the mail() function.

smtp_port int
Used under Windows only: Number of the port to connect to the server specified with the SMTP setting when sending mail with mail(); defaults to 25. Only available since PHP 4.3.0.
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

SMTP relays will end up on black lists immediately, so don't use those. And beware the free smtp servers for win32
because they will open relay to use your machine as a host.
If you do use one of these nightmare apps be sure to set port redirection on your firewall to avooid being used as a relay... muhahahha
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Neither of you answered my question.

I have an smtp server set in my php.ini, it's not a local one, it's my ISP's. But it requires authentication. Is there a way I can tell php.ini my authentication directives?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Sami wrote:I certainly don't have one locally, and it's working fine.
Well, what are you using then? If you're using php's mail function, then it's got to be set to something.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

The same thing you are; just my ISP's SMTP server. For me, I don't believe sending requires authentication, just the retrieval (POP3) part of the process.

Check out this Google search: [google]smtp authentication sendmail[/google]

I think that will have some answers to your questions.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

I have Covad DSL, and yes it does required my user/pass for sending mail.

That google search has nothing to do with my question.

My question, has to do with php.ini and php's mail function. Not sendmail or smtp auth.

:?
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

try this google search...
[google] pain in the butt [/google]
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

After a little more searching ..

I've concluded that the only way to use smtp auth with php is if you write your own mail functions using fsockopen (like phpBB does), or a already written class like this one.

http://phpmailer.sourceforge.net/
Post Reply