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.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending email from another server

    Hey everyone!

    I have a small problem and I was hoping that someone here could help me. Here it goes:

    I'm hosting a website on a server that doesn't support mail() function. It's disabled or something and I have no way of contacting the webmaster to enable it or anything.

    This company I'm doing this website for wants a contact form on their website. How do I do this? Is it possible that I could somehow forward data that user enters on the clients server to my server and use mail() function from my server?

    Hope you know what I want. Thanks for any help.

    Have a nice day,

    T

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    you could, or you could connect to an SMTP server and do it that way. something like Zend_Mail (a component of the Zend Framework) lets you do this quite easily:
    PHP Code:
    <?php
    require_once 'Zend/Mail.php';
    require_once 
    'Zend/Mail/Transport/Smtp.php';

    $config = array('auth' => 'login',
                    
    'username' => 'myusername',
                    
    'password' => 'password');

    $transport = new Zend_Mail_Transport_Smtp('mail.server.com'$config);

    $mail = new Zend_Mail();
    $mail->setBodyText('This is the text of the mail.');
    $mail->setFrom('sender@test.com''Some Sender');
    $mail->addTo('recipient@test.com''Some Recipient');
    $mail->setSubject('TestSubject');
    $mail->send($transport);
    http://framework.zend.com/manual/en/zend.mail.html
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • Users who have thanked GJay for this post:

    timgolding (10-30-2007)

  • #3
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for this. I found another php mail class called phpmailer (there's also swiftmailer) that supports SMTP authentication.

    Have fun,

    T


  •  

    Posting Permissions

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