Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    159
    Thanks
    37
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by hinch View Post
    PHP Code:
    [mail function]
    ; For 
    Win32 only.
    http://php.net/smtp
    SMTP localhost
    http://php.net/smtp-port
    smtp_port 25

    ; For Win32 only.
    http://php.net/sendmail-from
    sendmail_from you@yourdomain 
    Change SMTP= to your isp's mail server change send from to whatever you like.

    restart apache/services for xmpp

    as noted in the comments above and in my previous post its all well documented on the php.net website (even in your native language!)
    Hinch,


    I have configured my gmail account for these.

    PHP Code:
    [mail function]
     For 
    Win32 only.
     
    http://php.net/smtp
    SMTP smtp.gmail.com
     http
    ://php.net/smtp-port
    smtp_port 587

     
    For Win32 only.
     
    http://php.net/sendmail-from
    sendmail_from testnanitestmail@gmail.com 
    and I see crash report in the send mail folder....
    Last edited by nani_nisha06; 01-14-2013 at 03:32 PM.

  2. #17
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    159
    Thanks
    37
    Thanked 2 Times in 2 Posts
    Guys,

    Don't know some how these issue has been solved using below settings.


    If any still stuck like me can check the configurations as below & have success.....

    This is what worked for me Hopefully no one else will burn oil to figure this out like i did.

    Here is my sendmail.ini

    Code:
    [sendmail]
    
    smtp_server=smtp.gmail.com
    smtp_port=25
    error_logfile=error.log
    debug_logfile=debug.log
    auth_username=myemail@gmail.com
    auth_password=yourgmailpassword
    force_sender=myemail@gmail.com
    php/php.ini ----basically comment everything out except sendmail_path & mail.add_x_header

    Code:
    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    ;SMTP = localhost
    ; http://php.net/smtp-port
    ;smtp_port = 25
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    ;sendmail_from = postmaster@localhost
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
    
    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =
    
    ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
    mail.add_x_header = Off
    
    ; Log all mail() calls including the full path of the script, line #, to address and headers
    ;mail.log = "C:\xampp\apache\logs\php_mail.log"
    This worked for me after i updated the sendmail files (the old ones dont support smtp)

    go to http://glob.com.au/sendmail/ and grab the latest sendmail zip file
    unzip to desktop and copy the files into your \xampp\sendmail folder replacing everything that was there.EVERYTHING!
    Now open up sendmail.ini and copy paste what i showed above.(remove everything in that file first or just comment everything out!)
    NOTE: you dont need Mercury servers started for this.
    I was making a password recovery php on localhost when i encountered this problem. I needed to send users their password. - your php looks okey

    Please restart your Apache one have above settings......

  3. #18
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    I've never had any luck using PHPs SMTP support via the php.ini file. I never got it working after many trials.

    Instead, I use fakesendmail (google it). It allows you to use the mail() function (or a class like PHPMailer) but instead it will act as an SMTP client and send emails through your SMTP account.

    It's very good, I've been using it for years now and have no trouble with it.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  4. Users who have thanked tangoforce for this post:

    nani_nisha06 (01-14-2013)

  5. #19
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    Quote Originally Posted by tangoforce View Post
    I've never had any luck using PHPs SMTP support via the php.ini file. I never got it working after many trials.

    Instead, I use fakesendmail (google it). It allows you to use the mail() function (or a class like PHPMailer) but instead it will act as an SMTP client and send emails through your SMTP account.

    It's very good, I've been using it for years now and have no trouble with it.
    thats why i use swiftmail because its write once use anywhere library just tell it to use the smtp transport and it works the same on every server windows or unix based.

    using the windows based sendmail is not really a brilliant idea.
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  6. Users who have thanked hinch for this post:

    nani_nisha06 (01-14-2013)

  7. #20
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by hinch View Post
    thats why i use swiftmail because its write once use anywhere library just tell it to use the smtp transport and it works the same on every server windows or unix based.
    How so? You can't run a windows .exe on linux (unless under wine or a virtual machine) and vice versa. Or do you know something I don't? - do tell!!!

    Quote Originally Posted by hinch View Post
    using the windows based sendmail is not really a brilliant idea.
    Whys that then? It works very well! Any version of sendmail is just a SMTP client anyway (just like outlook express when sending) so I see no reason not to use it. IIRC, fakesendmail also comes with the delphi source code so that you can modify it too.
    Last edited by tangoforce; 01-14-2013 at 05:27 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  8. #21
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    Quote Originally Posted by tangoforce View Post
    How so? You can't run a windows .exe on linux (unless under wine or a virtual machine) and vice versa. Or do you know something I don't? - do tell!!!
    you can but relying on external applications as bridge layers adds an extra level of potential issues. say for example your windows xxx layer service crashes do you have ways of monitoring if its active or not? if not how many days was it before you realised your web app wasn't sending emails.

    There's a myriad of other reasons too. In some circumstances ie: clustered environments you may rely heavily on external abstraction or data interface layers (memcached is one you may be familiar with) however in most cases its simply not required.

    In this specific instance neither fakemail nor the windows compilation of sendmail have any for of monitoring short of you looking on the actual machine seeing if its still running (sendmail even more so since its not even in its native environment)


    Quote Originally Posted by tangoforce View Post
    Whys that then? It works very well! Any version of sendmail is just a SMTP client anyway (just like outlook express when sending) so I see no reason not to use it. IIRC, fakesendmail also comes with the delphi source code so that you can modify it too.
    send mail is evil even in its native environment not only for stability but also for configuration. the windows binary is just a cross platform compile but its older than the current live upstream, missing features and runs a generic config. You're far better being able to reference either the IIS internal SMTP server or a proper *nix based smtp server thats configured correctly. There's also a whole list of reasons why not to use sendmail even when in a unix environment but thats a little out of scope of this question.

    Also sendmail isnt an SMTP client at all! its an SMTP server nothing like outlook express when sending. Outlook express is simply a client which connects to a sendmail server for sending/routing.
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  9. #22
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by hinch View Post
    In this specific instance neither fakemail nor the windows compilation of sendmail have any for of monitoring short of you looking on the actual machine seeing if its still running (sendmail even more so since its not even in its native environment)
    Well fakesendmail (which is what I use) doesn't need monitoring because it isn't a service as such. It's simply an executable that PHP executes when the mail function is called. Having looked at the source for it I've seen no reference to the windows service manager and when using it it vanishes from the task manager as soon as the email is sent.

    Quote Originally Posted by hinch View Post
    You're far better being able to reference either the IIS internal SMTP server or a proper *nix based smtp server thats configured correctly.
    Maybe so but if it works, it works - why try fixing it

    Quote Originally Posted by hinch View Post
    Also sendmail isnt an SMTP client at all! its an SMTP server nothing like outlook express when sending. Outlook express is simply a client which connects to a sendmail server for sending/routing.
    What do you think any SMTP server does once it receives email that needs to go outbound elsewhere? - It connects to another SMTP server as a client. Servers can only connect to servers via the use of a client connection -the same as yahoo, gmail etc. I run my own self written SMTP server which has to handle incoming connections from sources such as yahoo and gmail which connect as clients using the SMTP protocol.

    To be honest though, I think you're getting a bit confused with my initial recommendation which was to use FAKEsendmail to get the op going. On a windows host using xampp (designed for usb key usage) running a system service is probably over kill anyway just for sending the odd email so fakesendmail should do the job pretty well (does for me, I've been using it for years).
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  10. #23
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    Quote Originally Posted by tangoforce View Post
    What do you think any SMTP server does once it receives email that needs to go outbound elsewhere? - It connects to another SMTP server as a client. Servers can only connect to servers via the use of a client connection -the same as yahoo, gmail etc. I run my own self written SMTP server which has to handle incoming connections from sources such as yahoo and gmail which connect as clients using the SMTP protocol.

    To be honest though, I think you're getting a bit confused with my initial recommendation which was to use FAKEsendmail to get the op going. On a windows host using xampp (designed for usb key usage) running a system service is probably over kill anyway just for sending the odd email so fakesendmail should do the job pretty well (does for me, I've been using it for years).
    I know exactly what an SMTP server does you appear to be getting confused between client server and distribution/routing protocols though.
    I'm not getting confused either with your recommendation however you are ignoring where the op says he resolved the issue using sendmail not your fakemail. Therefore he's running a windows compile of sendmail.
    You are also ignoring the fact that neither of you are writing portable code when using either direct sendmail or fakemail wrapper as both methods are relying/expecting an underlying sendmail binary to be available for sending on as calling mail() in php calls /usr/sbin/sendmail etc (this is why other servers such as postfix still implement a sendmail wrapper to allow legacy stuff like php to send via it even when sendmail isn't installed)

    Using a mail library (I only use swift as thats what i'm familiar with however there are others) and rather than calling the sendmail transport you rely on.
    By using a mail library and a direct SMTP transport it means your code can use any SMTPd regardless of if its exim/sendmail/postfix/iis/whatever. It also means you can easily use an external/non local host send server which in production environments is often the case where all mail goes through a different server to to the websites running on. Doing it your way for example would mean if your front end web servers don't run some form of SMTP you couldn't send mail. which would mean you either rewriting your code or adding in traps initially to detect which environment your code is running in and changing the mail system accordingly. Both of which add overhead and are unrequired.
    A programmer is just a tool which converts caffeine into code

    My work: http://www.fcsoftware.co.uk && http://www.firstcontactcrm.com
    My hobby: http://www.angel-computers.co.uk
    My life: http://www.furious-angels.com

  11. #24
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by hinch View Post
    I know exactly what an SMTP server does you appear to be getting confused between client server and distribution/routing protocols though.
    We'll have to agree to differ. For reasons that you'll see below, I'm going to agree with my version and understanding of it.

    Quote Originally Posted by hinch View Post
    I'm not getting confused either with your recommendation however you are ignoring where the op says he resolved the issue using sendmail not your fakemail.
    Actually, you're very wrong and yes you are very confused. Do you really think I don't recognise that ini file configuration that he quoted?

    Look at this:


    Note the url there in that picture.

    Quote Originally Posted by nani_nisha06 View Post
    This worked for me after i updated the sendmail files (the old ones dont support smtp)

    go to http://glob.com.au/sendmail/ and grab the latest sendmail zip file
    unzip to desktop and copy the files into your \xampp\sendmail folder replacing everything that was there.EVERYTHING!

    Please restart your Apache one have above settings......
    Note the URL in that quote - it matches - nani_nisha IS using FAKEsendmail - The title of the search result in my google search screen capture makes that perfectly clear.

    Let me re-quote this:
    Quote Originally Posted by hinch View Post
    I'm not getting confused ... the op says he resolved the issue using sendmail not your fakemail.
    Yes you are confused because he did exactly that - solved it with FAKEsendmail. You claim you're not confused yet you still can't grasp the concept that it is called fakesendmail and refer to it again as fakemail.

    Quote Originally Posted by hinch View Post
    Therefore he's running a windows compile of sendmail.
    No he isn't. He's running an equivalent of sendmail that works as a SMTP client.

    Quote Originally Posted by hinch View Post
    You are also ignoring the fact that neither of you are writing portable code when using either direct sendmail or fakemail wrapper as both methods are relying/expecting an underlying sendmail binary to be available for sending on as calling mail() in php calls /usr/sbin/sendmail etc (this is why other servers such as postfix still implement a sendmail wrapper to allow legacy stuff like php to send via it even when sendmail isn't installed)
    I do agree with this however the reality is that most webservers these days have sendmail or equivalent installed. It's only some wamp setups that seem to scrimp on it sometimes.

    However, i still disagree with you about sendmail / smtp. Sendmail is in general a SMTP client for its outgoing email. My own site uses sendmail and yes, I can see the live incoming SMTP connection from my SMTP servers live monitor.

    Take a look:
    http://en.wikipedia.org/wiki/Sendmail

    Sendmail is a general purpose internetwork email routing facility that supports many kinds of mail-transfer and -delivery methods, including the Simple Mail Transfer Protocol (SMTP) used for email transport over the Internet.
    Note that I am not saying SMTP is its only method of communication - I'm aware that sendmail may have other uses (none of which interest me) however for general outgoing email, you need to use SMTP (even you know that because you keep harping on about using SMTP instead of sendmail).

    Quote Originally Posted by hinch View Post
    Using a mail library (I only use swift as thats what i'm familiar with however there are others) and rather than calling the sendmail transport you rely on.
    By using a mail library and a direct SMTP transport it means your code can use any SMTPd regardless of if its exim/sendmail/postfix/iis/whatever. It also means you can easily use an external/non local host send server which in production environments is often the case where all mail goes through a different server to to the websites running on. Doing it your way for example would mean if your front end web servers don't run some form of SMTP you couldn't send mail. which would mean you either rewriting your code or adding in traps initially to detect which environment your code is running in and changing the mail system accordingly. Both of which add overhead and are unrequired.
    I have no issue with this as you are correct however it's user preference IMO. Fake/sendmail makes it easy for a user to dive in and send out emails. As I mentioned above, it's rare for a server not to have it installed unless its a wamp setup and even then you can use fakesendmail as I've mentioned.
    Last edited by tangoforce; 01-15-2013 at 04:17 PM.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •