+ Reply to Thread
Results 1 to 5 of 5

Thread: How i can use smtp server to send emails?

  1. #1
    ravigarg1985 is offline x10Hosting Member ravigarg1985 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    3

    How i can use smtp server to send emails?

    How i can use smtp server to send emails?

  2. #2
    apisds is offline x10Hosting Member apisds is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    21

    Re: How i can use smtp server to send emails?

    You have to set-up an smtp server first (of course). After setting one up, make a user account in the smtp server. Then configure an email client to use the server you created and use the account you created. You can now send emails through the smtp server!

    Of course, if you want a detailed answer you must specify your question a little bit further. Like, "How do I setup an smtp server using Ubuntu Linux on a pc box?".

  3. #3
    bunny.invasion76 is offline x10Hosting Member bunny.invasion76 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    12

    Smile Re: How i can use smtp server to send emails?

    Hi,

    I just use the php 'mail()' function to send mails...

    Greets,

  4. #4
    vv.bbcc19's Avatar
    vv.bbcc19 is offline Community Advocate vv.bbcc19 is just really nice
    Join Date
    Jun 2010
    Location
    India
    Posts
    1,505

    Re: How i can use smtp server to send emails?

    Here is how you can send a PHP Simple E-Mail
    The simplest way to send an email with PHP is to send a text email.

    In the example below I first declare the variables ($to, $subject, $message, $from, $headers), then we use the variables in the mail() function to send an e-mail:
    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    Note: This is the simplest way to send e-mail, but it is not secure.
    Regards,
    VVBB

    ---------- Post added at 07:19 PM ---------- Previous post was at 07:14 PM ----------

    With SMTP added,
    <?php
    require_once "Mail.php";

    $from = "Sandra Sender <sender@example.com>";
    $to = "Ramona Recipient <recipient@example.com>";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";

    $host = "mail.example.com";
    $username = "smtp_username";
    $password = "smtp_password";

    $headers = array ('From' => $from,
    'To' => $to,
    'Subject' => $subject);
    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

    $mail = $smtp->send($to, $headers, $body);

    if (PEAR::isError($mail)) {
    echo("<p>" . $mail->getMessage() . "</p>");
    } else {
    echo("<p>Message successfully sent!</p>");
    }
    ?>
    This will be a bit secure as SMTP is to be hit.
    Regards,
    VVBB
    BCV | Community Support Representative
    █ x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

  5. #5
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: How i can use smtp server to send emails?

    @vv.bbcc19: If you're going to copy a script, at least give the details of what is needed. There is a 'require_once "Mail.php";' in that script, how is ravigarg1985 supposed to know what that script is?

+ Reply to Thread

Similar Threads

  1. Using gmail smtp to send mails - server disconnects
    By Tarzan in forum Programming Help
    Replies: 5
    Last Post: 03-17-2011, 09:13 AM
  2. Send Wordpress Emails Through External SMTP Server
    By techairlines in forum Tutorials
    Replies: 2
    Last Post: 03-24-2010, 08:21 PM
  3. can't send emails
    By DarthVadre in forum Free Hosting
    Replies: 6
    Last Post: 04-17-2008, 08:41 PM
  4. can anyone send emails? i cant...
    By puppet in forum Free Hosting
    Replies: 3
    Last Post: 12-26-2007, 06:07 AM
  5. cant send emails via php and smtp service
    By ginkyo in forum Free Hosting
    Replies: 1
    Last Post: 11-22-2007, 07:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers