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 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts

    Help me configure mail function in XAMP

    Hi Frnds,


    As subject line I want to know how to configure mail function from XAMPP ..



    Please help.

    Thanks
    Nani

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .

    I use Test Mail Server Tool - it's dead easy.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    nani_nisha06 (01-14-2013)

  • #3
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by AndrewGSW View Post
    XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .

    I use Test Mail Server Tool - it's dead easy.
    Andrew,

    ya, send mail is really messy to use always what we get at end is crash report that's it ...

    any how can I user test mail server ....?

    Any step by step workout?

    Thanks A head....

  • #4
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    how can I user test mail server ....?
    Erm, install the application. Before you test your PHP (that sends an email) start the application. It will pop-up automatically with the email when it is sent.
    Added: If you have a default email-client (which you probably will have) the message will pop-up in, for example, Windows Live Mail or Outlook(Express).

    BTW Spending too much time testing locally-sent emails is not particularly fruitful; you'll only have to do it all over again remotely . But the application I have referred is dead simple.
    Last edited by AndrewGSW; 01-11-2013 at 08:52 PM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #5
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by AndrewGSW View Post
    Erm, install the application. Before you test your PHP (that sends an email) start the application. It will pop-up automatically with the email when it is sent.
    Added: If you have a default email-client (which you probably will have) the message will pop-up in, for example, Windows Live Mail or Outlook(Express).

    BTW Spending too much time testing locally-sent emails is not particularly fruitful; you'll only have to do it all over again remotely . But the application I have referred is dead simple.
    Andrew,

    whole concept of my PHP scrip is to fetch the data and send the mail to the DL list mentioned in the header.

    now i am using XAMPP for development and need to test whether the right information is going.

    Well with mail test server I have again failed my I dont know what mistake i am doing I have even try to check for any crash report but i dont find it anywhere.

    Please help me ..

    Regards,
    Nani

  • #6
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Sorry, I'm not using XAMPP currently so I don't know where an error log might be located.

    The problem might be in your script, so you could post some code and start a separate thread. However, your script may actually be working if you tried to send the email from your live site (rather than locally).

    Assuming your page uses variables like $email, $message, etc., use

    Code:
    print_r($email); // etc.
    just before sending the email. Then View the Source of the page to read these values to make sure they are correctly formed. var_dump() is another such function.

    Add the following so that PHP will display all errors:

    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors''1'); 
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #7
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Please find below code !!!
    PHP Code:
    <?php
    include_once "C:/xampp/htdocs/sam/include/db.php";

    //execute the SQL query and return records
    $result "SELECT * FROM $testcert WHERE Date = DATE_ADD(curdate(), INTERVAL 45 DAY)";
    $check=mysql_query($result);

    //fetch tha data from the database 
    while ($row mysql_fetch_array($check)) {
        
    $to "XXXXXXXXXXXXXXXX@yahoo.com";
        
    $subject "Test mail";
        echo 
    $message $row['description'];
        
    $from "testmailtome@google.com";
        
    $headers "From:" $from;
        
    mail($to,$subject,$message,$headers);
        echo 
    "Mail Sent.";
        }
    //close the connection
    mysql_close();
    ?>
    please help me if it the right way.................

    Quote Originally Posted by AndrewGSW View Post
    Sorry, I'm not using XAMPP currently so I don't know where an error log might be located.

    The problem might be in your script, so you could post some code and start a separate thread. However, your script may actually be working if you tried to send the email from your live site (rather than locally).

    Assuming your page uses variables like $email, $message, etc., use

    Code:
    print_r($email); // etc.
    just before sending the email. Then View the Source of the page to read these values to make sure they are correctly formed. var_dump() is another such function.

    Add the following so that PHP will display all errors:

    PHP Code:
    error_reporting(E_ALL);
    ini_set('display_errors''1'); 

  • #8
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    This would mean $testcert is an already defined variable which contains the name of a table? Otherwise, looks okay at a glance.

    But the mysql library is deprecated and you should use mysqli or PDO in preference, and prepared statements.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #9
    Regular Coder
    Join Date
    Sep 2012
    Posts
    100
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by AndrewGSW View Post
    XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .

    I use Test Mail Server Tool - it's dead easy.
    It's actaully Mercury..

    Tomcat is an Apache addon for Java:
    http://tomcat.apache.org/

    To answer the OP's question. I haven't used Mercury in ages so I don't know much about it... but google might be able to give you some insite..
    here is a direct link to the search

  • Users who have thanked Ctechinfo for this post:

    nani_nisha06 (01-14-2013)

  • #10
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by AndrewGSW View Post
    This would mean $testcert is an already defined variable which contains the name of a table? Otherwise, looks okay at a glance.

    But the mysql library is deprecated and you should use mysqli or PDO in preference, and prepared statements.
    Anderw,

    Agreed coz even I get mail sending promt while doing but I dont see any mails....


    Regards,
    naveen

  • #11
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    just edit php.ini to send via an external smtp relay? or use something like swiftmail or sending your mail that supports multiple transports.

    that way your email goes outbound and will arrive on a proper inbound account in exactly the same format as you would find on your live server.
    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

  • #12
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by hinch View Post
    just edit php.ini to send via an external smtp relay? or use something like swiftmail or sending your mail that supports multiple transports.

    that way your email goes outbound and will arrive on a proper inbound account in exactly the same format as you would find on your live server.
    Hinch,

    I have a inbuild sendmail server & as suggested by andrew I have also installed
    Code:
    http://www.toolheap.com/test-mail-server-tool/
    by disabling send mail still i dont find any solution ...

    Please help me incase you have any specific procedure with specific mail server like swiftmail.

    I am confused a lot.

    Thanks
    Nani

  • #13
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    you don't need to run a local mail server, you're connected to the internet. your ISP provides you with an open access relaying SMTP server.

    edit php.ini there's 4-5 lines in there were you can specify an outbound relay mail server.

    If doing it this way you can just use the standard php mail() command with no changes and it'll work fine.

    Alternatively you can use the swiftmail library for php and set the SwiftMailer::Transport to be SMTP and give it your ISP's outbound relay server (usually something like smtp.myisp.com or mail.myisp.com)

    Both methods will work both are well described on google and both the PHP homepage and the SwiftMailer homepage.

    If you're running on anything but a unix machine your local mail server attempt just wont work.
    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

  • #14
    Regular Coder
    Join Date
    Oct 2012
    Location
    mother land --india
    Posts
    165
    Thanks
    38
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by hinch View Post
    you don't need to run a local mail server, you're connected to the internet. your ISP provides you with an open access relaying SMTP server.

    edit php.ini there's 4-5 lines in there were you can specify an outbound relay mail server.

    If doing it this way you can just use the standard php mail() command with no changes and it'll work fine.
    I have already configured php.ini, not sure if you talking about the same 4-5 lines. Any post describe same....I have tried google but don't see any effective results.

    Thanks,
    Nani

  • #15
    Regular Coder hinch's Avatar
    Join Date
    Sep 2005
    Location
    UK
    Posts
    923
    Thanks
    25
    Thanked 80 Times in 80 Posts
    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!)
    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


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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