Page 1 of 2

Setting SMTP?

Posted: Thu Feb 26, 2004 10:24 pm
by Steveo31
Windows XP, Apache, etc.

I was hoping that this was going to work, and it didn't. Kinda figured, but was worth a try :)

Anyway...

Code: Select all

mail("ShutterbugEOS31@aol.com", "Website", "$data");
returns this error:

Code: Select all

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\program files\easyphp1-7\www\tester.php on line 43
Any ideas on how to do this? Or should I just hold off and not run commands like this from my machine?

Posted: Fri Feb 27, 2004 3:46 am
by Dr Evil
Hi
You have to d 2 things:

1) Check your smtp server, if you have none use the ISPs one or install one:
http://www.postcastserver.com/

2) Change the php.ini file in c:/windows:

Code: Select all

SMTP = smtp.server.com ; for win32 only
sendmail_from = me@myaddress.com ; for win32 only
;sendmail_path = ;for unix only, may supply arguments as well ; (default is sendmail -t)
that should do it !

Posted: Fri Feb 27, 2004 12:28 pm
by ol4pr0
you can do the following to make it somewhat easyer.. for as far as i remember it correctly.

There is a java package called James.. ( ill look in a bit where to get it)

just give me a sec....
_J_A_K_A_R_T_A__J_A_M_E_S___M_A_I_L__S_E_R_V_E_R


What is it?
-----------

JAMES is a 100% pure Java server application designed to be a complete,
portable and powerful enterprise mail engine solution based on currently
available open protocols (SMTP, POP3, IMAP, NNTP etc).

JAMES was formerly known as the Java Apache Mail Enterprise Server.

The Jakarta Project
http://jakarta.apache.org/
That should fix youre problems ;-)

Posted: Sun Feb 29, 2004 6:34 am
by Steveo31
Thanks Dr. Evil. I saw that same advice on another's thread, so I did a search, and this is what I came up with. Heh.

Anyway, I installed the Postcast server, the SMTP it told me to have was "D6C3Z021", and so I changed the SMTP line in the php.ini file to that. So now it reads:

Code: Select all

їmail function]
; For Win32 only.
;was localhost
SMTP = D6C3Z021

; For Win32 only.
sendmail_from = me@localhost.com
But I believe the sendmail_from is incorrect, as the SMTP is set as D6C3Z021 but the "from" address here is me@localhost.com. Is that a problem?

Thanks for your help.

@ ol4pr0:

I went to the link, thanks. The only prob is the files to download are not for windows, right? The whole tar.gz and mp5 files...

-Steve

Posted: Sun Feb 29, 2004 10:29 am
by Dr Evil
Make sure the host name in the postcast settings system tab is the same as the one specified in the php.ini file.

The sendmail_from can be your email address.

If you have a firewall make sure it's not blocking your postcast server.

Show us the error ! ( to check it worked don't forget to do a refresh in postcast)

Posted: Sun Feb 29, 2004 3:10 pm
by Steveo31
Thanks for keepin with me on this Dr.

Here's the specs in the SMTP settings:

Host Name: D6C3Z021
Port: 25

And the PHP.ini file:

Code: Select all

їmail function]
; For Win32 only.
;was localhost
SMTP = D6C3Z021

; For Win32 only.
sendmail_from = ShutterbugEOS31@aol.com
And the error:

Warning: mail(): Failed to connect to mailserver at "D6C3Z021" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\program files\easyphp1-7\www\tester.php on line 92

I'm assuming that the PostCast server has to be open to get it to work, right? Do I have to make and send a "new" message inside PostCast to open the connection or somethin?

Thanks again.

Posted: Sun Feb 29, 2004 3:18 pm
by Dr Evil
Yes PostCast must be running. The error you get is typical of php not finding the server.
Change the name of the server in php.ini and postcast config (ie computer name)

The setting is certainly wrong in postcast

Posted: Sun Feb 29, 2004 5:30 pm
by Steveo31
Excellent man, so far I'm not getting an error, but I'm not getting mail either. Could it be AOL blockin it or something? I know AOL is pretty touchy about that kinda stuff.

Dr.- what is your email config like? Do you use Outlook Express? I would like to, it seems pretty easy, but I don't know AOL's POP3 and SMTP settings, which I need for Outlook to get setup, right?

Thanks a lot man. Lifesaver you are.

:)

Posted: Sun Feb 29, 2004 5:34 pm
by Steveo31
Oh jeez....! Nevermind man, email arrived. I was lookin in the wrong program. Doh! Thanks a TON Dr. Evil.

Posted: Sat Mar 06, 2004 9:27 am
by JennFish
Ahh! Similar problem... okay, PostCast is running fine -- I can send e-mails from the program itself. Settings in PostCast indicate the host name is JENN server port 25.

My php-ini file:

Code: Select all

; For Win32 only.
SMTP = JENN

; For Win32 only.
;sendmail_from = heyjupiter_us@yahoo.com
My php code:

Code: Select all

mail("heyjupiter_us@yahoo.com","Test Subject","Test Message");
And, finally, the error:

Code: Select all

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\Apache Group\Apache2\htdocs\ftmc\registry_confirmadd.php on line 104
Any ideas? Thanks in advance! :)

Posted: Sat Mar 06, 2004 11:33 am
by Dr Evil
Have you restarted your servers ?
What happens if you try:

Code: Select all

<?php
mail("heyjupiter_us@yahoo.com","Test Subject","Test Message", "From: heyjupiter_us@yahoo.com");
?>

Posted: Sun Mar 07, 2004 6:00 pm
by JennFish
Dr Evil wrote:Have you restarted your servers ?
What happens if you try:

Code: Select all

<?php
mail("heyjupiter_us@yahoo.com","Test Subject","Test Message", "From: heyjupiter_us@yahoo.com");
?>
Thanks for the suggestions, Evil, but no dice. I pasted the suggested code in to no avail, and then restarted Apache and still nothin'. :(

Any other ideas? :?

Posted: Sun Mar 07, 2004 10:22 pm
by JennFish
In trying to find some sort of answer, I tried the following code:

Code: Select all

<?php
echo("SMTP = " . ini_get("smtp"));
?>
... I thought this would show me what I had set up in the php.ini file... ? Instead it showed SMTP =.

8O :?

Posted: Sun Mar 07, 2004 10:54 pm
by markl999
<?php phpinfo() ?>
...will show you your php.ini settings (amongst other things).

Posted: Mon Mar 08, 2004 10:01 am
by ol4pr0
Kinda late.. however JAMES is also there for windows ( or atleast it should be )