Page 1 of 1
mail() w/o SMTP?
Posted: Fri Feb 11, 2005 6:38 pm
by rxsid
Hi All,
I've got php 4.3.1 running on a windows 2003 advanced server. I was wondering if there is a way to be able to use php's mail() function w/o having the server setup for SMTP/POP3 on port 25, or even setup at all?
In other words, is there some way to use mail() (with COM?) to open a port, send the email, and then close the port?
Thanks!
Posted: Fri Feb 11, 2005 7:19 pm
by Chris Corbyn
As far as I'm aware the mail() function uses SMTP to send mail as per usual....
I can't see why not to use it...
Posted: Sat Feb 12, 2005 9:02 am
by Deemo
mail() is SMTP only
there is also
imap_mail(), but im not sure if that will help you
Posted: Sat Feb 12, 2005 2:05 pm
by s.dot
Sending mail without using PHP may be useful to you if you just need data sent to your email from other users. I'm not sure what the case is, but if so, this may be useful to you.
Taken from scriptschool.com/php Lesson 6
Sending email through a form without using PHP
To send email through a form you actually don't even need PHP, but there are several good reasons to use PHP. Using the form enctype we can directly dump the contents of a form to email like this:
<form METHOD=POST ENCTYPE="text/plain" action="mailto:
youremail@yourisp.com">
Name: <input type="text" name="name">
Your Email: <input type="text" name="email" size=40>
URL: <input type="text" name="url"> <input type="submit" value="Submit"></form>
While this is useful for some, there is a problem in that you can't actually label the contents of the form, you just get the results. This is where using PHP comes in and specifically the function called mail().
Posted: Sat Feb 12, 2005 2:30 pm
by Chris Corbyn
I'd steer clear of the mailto method if I was you.
I was set a project at work and was forced to use the mailto function but it's very unreliable and you can't manipulate the sent data enough to get a good result.
Also.... this falls down depending upon the default mail client the user is using and whether or not they actually have anything set up in the default mail client.... plaenty of people rely on webamil these days such as hotmail.
Take it from me... it's not a good thing to use.
Maybe you should look further in imap_mail()
...
Posted: Sat Feb 12, 2005 3:47 pm
by s.dot
He may not have a choice. If he needs data, he will have to rely on mailto. The data won't be organized, but some data's better than no data, BTW, why isn't your SMTP server set up?
Posted: Sat Feb 12, 2005 4:01 pm
by Chris Corbyn
Would that be my smtp server or rxsid's smtp? Mine is set up yes but rxsid doesn't wish to use it even if it is set up. I agree with what ur saying but I found using mailto to be very unreliable...
Posted: Sat Feb 12, 2005 11:32 pm
by d3ad1ysp0rk
mailto wouldn't work. at all.
it would prompt the user with their mail client and try to send email FROM THEM. Very unlikely that is what he wants.
What's wrong with
imap_mail?