Results 1 to 6 of 6

Thread: Send email in Ubuntu using PHP

  1. #1
    Join Date
    Mar 2010
    Posts
    200

    Send email in Ubuntu using PHP

    Hello,
    I am installing a small server in my power to put my sites. I need to send email from PHP5 with mail (). But now, I can not find what I need in the Ubuntu doc and google. In fact I do not want a mail server to receive mail, I just want to send thanks to PHP5. Any help on this is appreciated. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    356

    Re: Send email in Ubuntu using PHP

    Hello,
    I would recommend install an SMTP server. By cons I advise you to install sendmail and look in the conf sendmail normally / etc / sendmail you should have simple pieces of code commented out (line starts with #) and everything you need is to set the smtp server address and port. Most box resulted in limited sending to port 22 emails that do not go to the ISP's SMTP, then we must also find useful name and password. I hope this information will help you.

  3. #3
    Join Date
    Nov 2009
    Posts
    359

    Re: Send email in Ubuntu using PHP

    Hello,
    I tried to change some php.ini (I do not even know if it's good) but still the same error persists: Warning: Failed to Connect in d: \ EasyPHP \ www \ mail.php on line 50, and I did copy some tutorial and studied on it, the mail () does not even attempt to establish a link or connection as if it were a syntax error (the response is quick and brutal). If you have any alternative solution for this then please let me know.

  4. #4
    Join Date
    Nov 2009
    Posts
    583

    Re: Send email in Ubuntu using PHP

    Hello,
    It is normal that you did not understand. Are you sure the forum Linux & Mac then the advice we give does not apply to the windows so not easy php. If you do not understand the protocols used I do not see how you could learn to send an email. I think you should take a small tutorial on the networking concepts, I recommend you to so though some of the networking concepts and then do the coding or the configuring part later.

  5. #5
    Join Date
    Nov 2009
    Posts
    518

    Re: Send email in Ubuntu using PHP

    Hello,
    I agree with the above post and would like to add some more information to it, and it would help you for sure. Smtp is what people use every day when sending mail through external software, such as Outlook or Thunderbird. (Other than sites like hotmail or gmail or yahoo). I advise you to start a topic on windows or php. For your error trying to see if your firewall does not block or php wamp. Hope you will configure this correct and use it successfully.

  6. #6
    Join Date
    Nov 2009
    Posts
    343

    Re: Send email in Ubuntu using PHP

    Hello,
    See if this PHP code helps you
    Code:
    <?php
    
    $to = "re@ex.com";
    
    $subject = "Hi!";
    
    $body = "Hi,\n\n Some text here?";
    
    if (mail($to, $subject, $body)) {
    
      echo("<p>successfully sent!</p>");
    
     } else {
    
      echo("<p> delivery failed...</p>");
    
     }
    
    ?>

Similar Threads

  1. Replies: 4
    Last Post: 23-08-2011, 08:04 AM
  2. Replies: 6
    Last Post: 10-07-2011, 08:26 PM
  3. Replies: 4
    Last Post: 27-02-2011, 04:32 AM
  4. Windows live mail couldn't send email but can receive email
    By danielyen in forum Windows Software
    Replies: 1
    Last Post: 15-07-2010, 12:17 AM
  5. Replies: 2
    Last Post: 14-02-2008, 09:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,724,846.76946 seconds with 16 queries