Page 1 of 1

email() & port number

Posted: Wed Jun 19, 2002 4:44 am
by weazel
In my company we have en experimentel smtp-server which runs on port 26. Is there any way to tell the php mail function to use port 26 instead of 25 for sending mail?

greetz
weazel

Posted: Wed Jun 19, 2002 10:41 am
by Zmodem
Yes, most SMTP servers will let you configure it to listen on a different port. But how you go about this varies from server to server.

What software ya using?

Posted: Wed Jun 19, 2002 11:00 am
by fatal
when you put in your SMTP server in, ex:'mail.mirci.com'. Add a port number at the end, 'mail.mirci.com:26'

That could help you out somewhat.

Posted: Wed Jun 19, 2002 11:03 am
by Zmodem
DOH! I misread, sorry.

Note to self - Get more coffee before answering questions in the forums :/

Posted: Thu Jun 20, 2002 4:55 am
by weazel
Zmodem wrote:DOH! I misread, sorry.
Get more coffee ... snip
Yeah that would help a lot :D

This thing with just attaching the port number to the domain doesn't seem to work. This is a fragment of my script:

Code: Select all

$strSubject = "none";
$strMessage = "some text";
$strHeaders = "From: me@mydomain.com:26\r\nReply-To:webmaster@mydomain.com";
if (!mail($arrayї"eMail"], $strSubject, $strMessage, $strHeaders))
{
 // do s.th. special
 }
I think I did it right with the port number ..

Posted: Thu Jun 20, 2002 4:58 am
by twigletmac
You have to add the port number to where you specify the SMTP server in the php.ini file.

Mac

Posted: Thu Jun 20, 2002 6:49 am
by volka
Mail functions
...
SMTP string
Used under Windws only: DNS name or IP address of the SMTP server PHP should use for mail sent with the mail() function.

SMTP int
Used under Windws 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.
...
on unix the local mailer is used. So this one has to be set up to use another port (if it uses sockets to connect the next MTA)

Posted: Thu Jun 20, 2002 6:55 am
by twigletmac
Only available since PHP 4.3.0
So when that's released as a stable version you're set.

Mac

Damn!

Posted: Sat Jun 22, 2002 2:34 pm
by weazel
Well, port 26 still doesn't work because of PHP4.2.0 :cry: and now port 25 doesn't want anymore too... I think I shot s.th. :roll:

/*add
Now it's working again and with port 26 too :D
Two new routing rules thats all.

Thanks for your help, pals :)
*/