#1
  1. No Profile Picture
    WebGuru
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    74
    Rep Power
    17

    php mail, mailing from php


    would someone point me to a tutorial on mailing from Php?

    or if someone is a php mailing master, give me a few tips?
    BooDog
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    south pole
    Posts
    48
    Rep Power
    17

    Talking mail function


    phpsolutions.co.uk

    go her e4 the full article but the basic mail function looks like this!
    PHP Code:
    $to "info@phpsolutions.co.uk";
    $subject " new user registration";
    $body " has a new member, ";
    $from "FROM: phpsolutions ";

    mail ($to$subject$body$from); 
    enjoy
    ..,.,.,,.
    C 'C' C
    > * <
  4. #3
  5. No Profile Picture
    WebGuru
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    74
    Rep Power
    17
    thanks for the quick response!!

    I didn't know php mailing was that simple
    BooDog
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2001
    Location
    London, UK
    Posts
    661
    Rep Power
    17
    PHP Code:
    <?
    $to 
    "mk_jnr@hotmail.com";
    $subject "new user registration";
    $body "has a new member";
    $from "FROM: phpsolutions";
    mail ($to,$subject,$body,$from);
    ?>
    Tried that code but I'm getting this error:

    Warning: Unknown error in c:\phpdev\www\mail.php on line 6

    I thinks its the same code as on
    http://www.phpsolutions.co.uk/articl...thread&order=0

    BUt it wont work

    Mk
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Indianapolis, IN
    Posts
    3
    Rep Power
    0
    I have never been able to use the mail() function. I never get an error message and everything goes through like it worked but no e-mail ever comes. What does work for me is:

    $mailcmd = "/usr/sbin/sendmail -t";

    $message =
    "From: johndoe@someplace.com
    To: janedoe@someplace.com
    Subject: Here is a Subject

    Here is where the message would be
    ";

    $fp=popen($mailcmd,"w");
    fputs($fp,$message);
    pclose($fp);

    I would like to be able to use the mail() function since it is simpler to use. Anyone have an idea why this works but mail() doesn't?
  10. #6
  11. No Profile Picture
    Senior Member
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Location
    Boston Ma.
    Posts
    1,529
    Rep Power
    0
    Hi


    From: Email not correct..............


    Should be............


    $from = "FROM: phpsolutions@domain.com";



    example...........
    $sitename = "My Site";
    $sender_name = "Postmaster";
    $sender_email = "Postmaster\@somesite.com";
    $send_to_email = "me\@to_u.com";
    $e_mail_subj = "Hello There!";

    $message = "This is a service of $sitename\n";
    $message .= "bla bla bla\n";
    $message .= "bla bla bla\n";
    $message .= "bla bla bla\n";
    $message .= "\r\nYours Truely\n\n$sender_name";


    mail($sendto_email, $e_mail_subj, $message, "From: \"$sender_name\" <\"$sender_email\">\n");




    F!
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    south pole
    Posts
    48
    Rep Power
    17

    phpdev


    i c that you are useing phpdev ... if im right then it wont work cause its running as your localhost and is on your pc ,upload your script to a server and re run it then it should work out,

    ps i use phpdev as well and came accross the same problem.
    ..,.,.,,.
    C 'C' C
    > * <
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    USA
    Posts
    313
    Rep Power
    22

    FeedBack Form


    Here is a link to a feedback form I posted on my site will help you with the mail as well..

    http://www.ipdg3.com/sourcecoderesul...code&id=000189
  16. #9
  17. No Profile Picture
    WebGuru
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Posts
    74
    Rep Power
    17
    I tried the suggestion from aidanpeiser

    It worked for me... I sent about 20 emails to myself testing...
    BooDog
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2001
    Location
    London, UK
    Posts
    661
    Rep Power
    17

    Re: phpdev


    Originally posted by aidanpeiser
    i c that you are useing phpdev ... if im right then it wont work cause its running as your localhost and is on your pc ,upload your script to a server and re run it then it should work out,

    ps i use phpdev as well and came accross the same problem.
    ah, i see whys that, do ya kno by ne chance????

IMN logo majestic logo threadwatch logo seochat tools logo