+ Reply to Thread
Results 1 to 6 of 6

Thread: [?] how to send mail in php?

  1. #1
    bo17age is offline x10Hosting Member bo17age is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    6

    [?] how to send mail in php?

    [?] how to send mail in php?
    thanks alot ^^!

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: [?] how to send mail in php?

    Code:
    <?php
    $to      = 'nobody@example.com';
    $subject = 'the subject';
    $message = 'hello';
    $headers = 'From: webmaster@example.com' . "\r\n" .
        'Reply-To: webmaster@example.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    
    mail($to, $subject, $message, $headers);
    ?>
    For more info, see here.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: [?] how to send mail in php?


  4. #4
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: [?] how to send mail in php?

    You can also use the following code..
    $to="someone@someweb.com;
    $subject="Put in your subject here";
    $message="Put your message here";
    $header="From: sender@sender.com";

    mail($to, $subject, $message, $header);


    this is similar to the above except that some header variable are removed.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  5. #5
    rima123 is offline x10Hosting Member rima123 is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    9

    Re: [?] how to send mail in php?

    best script for secured as well as basic mail....

    <html>
    <body><?php
    if (isset($_REQUEST['email']))
    //if "email" is filled out, send email
    {
    //send email
    $email = $_REQUEST['email'] ;
    $subject = $_REQUEST['subject'] ;
    $message = $_REQUEST['message'] ;
    mail( "someone@example.com", "Subject: $subject",
    $message, "From: $email" );
    echo "Thank you for using our mail form";
    }
    else
    //if "email" is not filled out, display the form
    {
    echo "<form method='post' action='mailform.php'>
    Email: <input name='email' type='text' /><br />
    Subject: <input name='subject' type='text' /><br />
    Message:<br />
    <textarea name='message' rows='15' cols='40'>
    </textarea><br />
    <input type='submit' />
    </form>";
    }
    ?></body>
    </html>

  6. #6
    messa is offline x10Hosting Member messa is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    12

    Re: [?] how to send mail in php?

    You can use this to test if your site is capable of sending mail

    <?
    mail("emailadres@privoder.com","test","Ok, it works");
    ?>

+ Reply to Thread

Similar Threads

  1. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  2. Replies: 3
    Last Post: 12-03-2007, 08:56 PM
  3. mail() disabled w/ php v2
    By greenie in forum Free Hosting
    Replies: 1
    Last Post: 11-02-2007, 09:06 PM

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