SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would I have a message sent to a user that just registered? Lets say John goes to the site and registers with the e-mail john@smith.com. How would I make a script to automatically send a template yet personalized message to John?

    Any help is much appreciated.


  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try something like this (obvious modification required):

    Code:
    $email = "$useremail";
    $subject = "Email Subject Here";
    $body = "Hi $name ($useremail), 
    
    Thanks for registering!";
    $mail_hrd = "From: John Doe <john@doe.com>"; 
    mail($email,$subject,$body,$mail_hrd);
    Hope that helps.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the php mail() function. This takes three mandatory args and a fourth optional one

    mail("to", "subject", "body", "optionalheaders");


    Step 1 get the email address from the registration and assign it to
    $to = $emailfromregistration;
    $headers = "From: you@yourdomain.com\r\n";
    $subject = "The subject of the email";
    $body .= "This is where you would do the template part you could either have a separate file with the template in, which is sometimes what I do in this situation.\n";
    $body .= "Use \n to make a newline in your mail body.\n";


    mail($to, $subject, $body, $headers);

    That's it.

    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry Chris I posted before checking if anyone else had posted first.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem at all - you provided some more useful information. In fact, seeing as how you are the resident PHP-Demi-God, I really ought not to have gotten in your way.

  6. #6
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nonsense, no one can know everything about PHP, I would never claim to be even an expert at PHP, I learn something new everyday. Don't sell yourself short Chris, if my memory serves me correct you are what 16 years old, when I was 16 do you think I even knew how to turn a computer on, Nope!
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  7. #7
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL - I was just kidding around. Thank you for the kind words though. What's truly amazing is that there are thousands of kids years younger than myself who have an even bigger head start. Mind-boggling.

  8. #8
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a new era, a new age, a new society

    its the young ones who can work the companies better .. learning from experience pays much more than learning from books (except ADT's)
    cogito, ergo sum

  9. #9
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree Vinay - and I'm backing some of my future on it. I plan to visit a Technical Institute most likely, but overall I see myself in good shape walking into a job interview at age 22 with 8 years experience in the field of web development and computers.

  10. #10
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree, I wish I had started younger, My Dad bought us an Apple IIe when I was around 12, we messed around on it a bit but I really never had an interest until I was 25, now I am way behind the times, there is so much I want to know, I never went to college. But I am starting to think, like Chris) I want to take some classes at a tech school, maybe Java and C++ or something. But kids these days are out of control. They are learning so much faster and so much more, that is why I am 28 and working for a 20 year old kid.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  11. #11
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't sing the blues to loud guys. I'm 40 (a dinosor) with 17 years of mainframe experience. Now I'm trying to break into the cool stuff. From my prospective, you have no idea how much there is to learn.

    But event though I'm 40, I'll kick your *** in a 10K (PB 37:40).

  12. #12
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran a 10k once PB(59:59)
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  13. #13
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh man, you need work. Less time on Site Point. More time in the Nike's (Asics would be my preference).

  14. #14
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Freddy: checkout http://www.itt-tech.com - they have 70 campuses (did I spell that right?) across the country and offer programs teaching C++ and Java specifically. They have a few Bachelor Courses, and a few Associate Degrees as well.

  15. #15
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Chris, too bad there isn't one of those within 100 miles of where I live. The funny thing is I would be stoked to take some classes there, 10 years ago when I was in high school we used to make fun of that place. How Sad(on my part)!
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  16. #16
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL. Yeah, I see what you mean. I'd be stoked, too - anxious to get moving. It'd be refreshing after spending all this time teaching myself things with online tutorials and 1,000-page books!

  17. #17
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only response I have to that is, how can you be sure that the guy teaching this stuff in the classes' methods are any better than the ones you learn on your own. AT least that has been my experience. In the fifth grade we learned long division, the teach er called my parents and said he had a problem with me because I wouldn't follow all the steps he was teaching in order to get an answer. I would do it in my head. So was I wrong because I could get the answer in a fifth of the time he was trying to make us get it in. In his eyes yes, in my eyes "Hell No!"
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  18. #18
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same thing happened to me in 5th grade (10 years old, mostly) math class - the teacher tells me I need to start showing my work. I tell him that that takes too long and I can do it all in my head.

    He then says that he can't trust that, because for all he knows the answers could be written in the book somewhere - I tell him he can look at it anytime he wants. He didn't bothered me about it anymore, thankfully.

    As for a teacher and his/her methods: maybe they arn't as good, but people tend to learn at a more steady, reliable rate in situations like that. There is a pressure to learn of sorts when you're part of a class with a teacher instructing you.

    Good for some situations, bad for eithers, I'd say.


Bookmarks

Posting Permissions

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