mail() function in PHP

the mail() function

Moderators: macek, egami, gesf

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

mail() function in PHP

Postby imroue » Tue Nov 19, 2002 4:53 pm

I have this code that I am running. I use WinXP pro. IIS.
When I run this piece of code it just hangs and then times out.

If i take it out my code works( so I know it's something here).

Any hints?

Code: Select all

if (strtoupper($notify)=="YES") {
      $msgtitle = "test Message from your site";
      $vcomment = str_replace(""","\"",$vcomment);   
      $vcomment = stripslashes($vcomment);
      $msgcontent = "Local time : $tgl\n\nThe addition from $vname reads :\n---------------------\n\n$vcomment\n\n-----End Message-----";
      mail($admin_email,$msgtitle,$msgcontent,"From: $vemail\n");
   }

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Nov 20, 2002 2:19 am

mail function want to connect with mail - server , whitch not installed on your PC =)

options in ypu php.ini file =)

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Wed Nov 20, 2002 5:25 am

Pejone wrote:mail function want to connect with mail - server , whitch not installed on your PC =)

options in ypu php.ini file =)


I have IIS installed with the Virtual SMTP server installed.
Is there a way for me to configure the IIS SMTP to work with PHP?

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Wed Nov 20, 2002 5:46 am

imroue wrote:
Pejone wrote:mail function want to connect with mail - server , whitch not installed on your PC =)

options in ypu php.ini file =)


I have IIS installed with the Virtual SMTP server installed.
Is there a way for me to configure the IIS SMTP to work with PHP?

Sorry, but in IIS and Win2000/XP you do not have SMTP server....

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Wed Nov 20, 2002 5:49 am

WiZARD wrote:
imroue wrote:
Pejone wrote:mail function want to connect with mail - server , whitch not installed on your PC =)

options in ypu php.ini file =)


I have IIS installed with the Virtual SMTP server installed.
Is there a way for me to configure the IIS SMTP to work with PHP?

Sorry, but in IIS and Win2000/XP you do not have SMTP server....


But what is the "Default SMTP Virtual Server" in my IIS then?
Is this something totaly different?
Do you have any suggestions of a free smtp server?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Nov 20, 2002 6:04 am

php.ini

[mail function]
; For Win32 only.
SMTP = smtp.pejone.net ; for Win32 only

; For Win32 only.
sendmail_from = pejone@pejone.net ; for Win32 only

; For Unix only. You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path =

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Wed Nov 20, 2002 6:05 am

Pejone wrote:php.ini

[mail function]
; For Win32 only.
SMTP = smtp.pejone.net ; for Win32 only

; For Win32 only.
sendmail_from = pejone@pejone.net ; for Win32 only

; For Unix only. You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path =


Thanks Pejone.
Does this mean, that I don't need an SMTP server and that PHP will automatically use my ISP's SMTP?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Nov 20, 2002 6:13 am

yes.
but you can have a own smtp server =)

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Wed Nov 20, 2002 6:17 am

Pejone wrote:yes.
but you can have a own smtp server =)



I tried it and now I get a new error:

Warning: Mailserver rejected our "sendmail_from" setting in E:\Web\OurSite\guestbook\ardguest.php on line 583


This is what i changed... I think the SMTP passed
but the sendmail_from (did not :cry:)

[mail function]
; For Win32 only.
SMTP = 66.185.95.99 ; for Win32 only

; For Win32 only.
sendmail_from = imroue74@rogers.com ; for Win32 only


Do you think the "IIS Virtual SMTP server" can be used for something? I would rather NOT use my own SMTP server (if possible). I would like to use the smtp server that my isp has.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Wed Nov 20, 2002 6:28 am

imroue wrote:Thanks Pejone.
Does this mean, that I don't need an SMTP server and that PHP will automatically use my ISP's SMTP?

I think what you not sure that is that SMPT - SimplyMailTransferProtocol.
But if you need send you may use you're virtual server.... if can configured this service.... I hate Microsoft for that!

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Wed Nov 20, 2002 8:18 am

I think what you not sure that is that SMPT - SimplyMailTransferProtocol.
But if you need send you may use you're virtual server.... if can configured this service.... I hate Microsoft for that!


Thanks for the reply WIZARD.
I think that is the problem. I can't figure out how to setup the virtual server for microsoft. Maybe you can tell me of another server I can use and configure.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Thu Nov 21, 2002 1:16 am

imroue wrote:
I think what you not sure that is that SMPT - SimplyMailTransferProtocol.
But if you need send you may use you're virtual server.... if can configured this service.... I hate Microsoft for that!


Thanks for the reply WIZARD.
I think that is the problem. I can't figure out how to setup the virtual server for microsoft. Maybe you can tell me of another server I can use and configure.

You may use SMTP server your's ISP (InternetServiceProvider) but firstly you need check this by telnet <adress> 25. If server respond, you may use this in php.ini

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Thu Nov 21, 2002 11:46 am

WiZARD wrote:
imroue wrote:
I think what you not sure that is that SMPT - SimplyMailTransferProtocol.
But if you need send you may use you're virtual server.... if can configured this service.... I hate Microsoft for that!


Thanks for the reply WIZARD.
I think that is the problem. I can't figure out how to setup the virtual server for microsoft. Maybe you can tell me of another server I can use and configure.

You may use SMTP server your's ISP (InternetServiceProvider) but firstly you need check this by telnet <adress> 25. If server respond, you may use this in php.ini


Thans Wizard, that worked and I am able to send mail now :lol:

One last question concerning this, the
send_mail_from = NULL.

When I put an address there, it doesn't work. What is it for?

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Tue Dec 17, 2002 12:32 am

imroue wrote:
WiZARD wrote:
imroue wrote:
I think what you not sure that is that SMPT - SimplyMailTransferProtocol.
But if you need send you may use you're virtual server.... if can configured this service.... I hate Microsoft for that!


Thanks for the reply WIZARD.
I think that is the problem. I can't figure out how to setup the virtual server for microsoft. Maybe you can tell me of another server I can use and configure.

You may use SMTP server your's ISP (InternetServiceProvider) but firstly you need check this by telnet <adress> 25. If server respond, you may use this in php.ini


Thans Wizard, that worked and I am able to send mail now :lol:

One last question concerning this, the
send_mail_from = NULL.

When I put an address there, it doesn't work. What is it for?

Some admins protect SMTP for spam and floode....


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests

cron