Sending a mail through exchange server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rajendran

    Sending a mail through exchange server

    I want to send mail through PHP using the MS Exchange server.
    My php.ini file looks like this (for the MAIL functions)
    -------
    [mail function]
    ; For Win32 only.
    SMTP = exchgserver.tes t.com
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = thegoodboy@test .com
    -------
    The following extensions have been loaded as well.
    extension=php_i map.dll
    extension=php_l dap.dll
    After making these changes there were no errors/warnings. But I'm
    unable to send any mails.
    What are the other changes that i should do to send mails?

  • pacal

    #2
    Re: Sending a mail through exchange server

    Rajendran wrote:
    I want to send mail through PHP using the MS Exchange server.
    My php.ini file looks like this (for the MAIL functions)
    -------
    [mail function]
    ; For Win32 only.
    SMTP = exchgserver.tes t.com
    smtp_port = 25
    >
    ; For Win32 only.
    sendmail_from = thegoodboy@test .com
    -------
    The following extensions have been loaded as well.
    extension=php_i map.dll
    extension=php_l dap.dll
    After making these changes there were no errors/warnings. But I'm
    unable to send any mails.
    What are the other changes that i should do to send mails?
    >
    try sending mail with a mail client like thunderbird
    and see if that succeeds or fails
    if that also fails it could give a clue about whats happening

    greets
    pacal

    Comment

    • Jerry Stuckle

      #3
      Re: Sending a mail through exchange server

      Rajendran wrote:
      I want to send mail through PHP using the MS Exchange server.
      My php.ini file looks like this (for the MAIL functions)
      -------
      [mail function]
      ; For Win32 only.
      SMTP = exchgserver.tes t.com
      smtp_port = 25
      >
      ; For Win32 only.
      sendmail_from = thegoodboy@test .com
      -------
      The following extensions have been loaded as well.
      extension=php_i map.dll
      extension=php_l dap.dll
      After making these changes there were no errors/warnings. But I'm
      unable to send any mails.
      What are the other changes that i should do to send mails?
      >
      Do you actually have host exchgserver.tes t.com? What happens if you try
      to ping it from your command line?

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Rajendran

        #4
        Re: Sending a mail through exchange server

        On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
        Rajendran wrote:
        I want to send mail through PHP using the MS Exchange server.
        My php.ini file looks like this (for the MAIL functions)
        -------
        [mail function]
        ; For Win32 only.
        SMTP = exchgserver.tes t.com
        smtp_port = 25
        >
        ; For Win32 only.
        sendmail_from = thegood...@test .com
        -------
        The following extensions have been loaded as well.
        extension=php_i map.dll
        extension=php_l dap.dll
        After making these changes there were no errors/warnings. But I'm
        unable to send any mails.
        What are the other changes that i should do to send mails?
        >
        Do you actually have host exchgserver.tes t.com? What happens if you try
        to ping it from your command line?
        >
        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstuck...@attgl obal.net
        =============== ===
        When I try to ping that server it says "Request Time out"
        I've configured my outlook with this server and I'm using it to send
        and receive mails.

        <?php
        //change this to your email.
        $to = "raj@yahoo.com" ;
        $from = "raj@test.c om";
        $subject = "Hello! This is HTML email";
        //begin message
        $message = <<<EOF
        <html>
        <body bgcolor="#DCEEF C">
        <center>
        <b>Looool!!! I am reciving HTML email......</b<br>
        <font color="red">Tha nks!</font<br>
        <a href="http://www.gmail.com/">Gmail</a>
        </center>
        <br><br>*** Now you Can send HTML Email through PHP<br>
        Regards<br>Raje n
        </body>
        </html>
        EOF;
        //end of message
        $headers = "From: $from\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "$to, $from"; // this will send to both emails at the same
        time.
        // now lets send the email.
        $mail_sent = @mail($to, $subject, $message, $headers);
        echo $mail_sent ? "Mail sent" : "Mail failed";
        ?>
        That is the php script which i copied from phpfreaks.com

        Comment

        • Jerry Stuckle

          #5
          Re: Sending a mail through exchange server

          Rajendran wrote:
          On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
          >Rajendran wrote:
          >>I want to send mail through PHP using the MS Exchange server.
          >>My php.ini file looks like this (for the MAIL functions)
          >>-------
          >>[mail function]
          >>; For Win32 only.
          >>SMTP = exchgserver.tes t.com
          >>smtp_port = 25
          >>; For Win32 only.
          >>sendmail_fr om = thegood...@test .com
          >>-------
          >>The following extensions have been loaded as well.
          >>extension=php _imap.dll
          >>extension=php _ldap.dll
          >>After making these changes there were no errors/warnings. But I'm
          >>unable to send any mails.
          >>What are the other changes that i should do to send mails?
          >Do you actually have host exchgserver.tes t.com? What happens if you try
          >to ping it from your command line?
          >>
          >--
          >============== ====
          >Remove the "x" from my email address
          >Jerry Stuckle
          >JDS Computer Training Corp.
          >jstuck...@attg lobal.net
          >============== ====
          >
          When I try to ping that server it says "Request Time out"
          I've configured my outlook with this server and I'm using it to send
          and receive mails.
          >
          <?php
          //change this to your email.
          $to = "raj@yahoo.com" ;
          $from = "raj@test.c om";
          $subject = "Hello! This is HTML email";
          //begin message
          $message = <<<EOF
          <html>
          <body bgcolor="#DCEEF C">
          <center>
          <b>Looool!!! I am reciving HTML email......</b<br>
          <font color="red">Tha nks!</font<br>
          <a href="http://www.gmail.com/">Gmail</a>
          </center>
          <br><br>*** Now you Can send HTML Email through PHP<br>
          Regards<br>Raje n
          </body>
          </html>
          EOF;
          //end of message
          $headers = "From: $from\r\n";
          $headers .= "Content-type: text/html\r\n";
          $to = "$to, $from"; // this will send to both emails at the same
          time.
          // now lets send the email.
          $mail_sent = @mail($to, $subject, $message, $headers);
          echo $mail_sent ? "Mail sent" : "Mail failed";
          ?>
          That is the php script which i copied from phpfreaks.com
          >
          A lousy script - html email should always be sent multipart - with text
          and html parts. But that's beside the point.

          What errors do you get? "It doesn't work" isn't very descriptive.

          The fact you can't ping the server may be telling - or it may not. It's
          possible the server is not available from your webserver; but it's also
          possible the sysadmin has disabled icmp echo requests (I normally do).

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...