Results 1 to 14 of 14

Thread: Email

  1. #1

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702

    Email

    How can I send an email through my website server. Like through a SMTP server I already have? Thx. I know that was general.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Use the PHP mail() function.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Or do you want to set up Outlook Express to do that for you?

  4. #4

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by mendhak
    Use the PHP mail() function.
    Well, When I use the mail() function it trys to send it through outlook express. I want the people on the website to be able to send mail through my site without having to use Outlook Express. Alot of people use hotmail,yahoo,and so on.

    -duc

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by duc
    Well, When I use the mail() function it trys to send it through outlook express. I want the people on the website to be able to send mail through my site without having to use Outlook Express. Alot of people use hotmail,yahoo,and so on.

    -duc

    You probably mean the mailto action in the <FORM> tag, right? The PHP mail() function allows for your web visitors to send an email through a web interface using your server's SMTP. For an example, look at the "Tell a Friend" link on my site, or the "Mail Me" link. Both use my server's SMTP.

  6. #6

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by mendhak
    You probably mean the mailto action in the <FORM> tag, right? The PHP mail() function allows for your web visitors to send an email through a web interface using your server's SMTP. For an example, look at the "Tell a Friend" link on my site, or the "Mail Me" link. Both use my server's SMTP.
    Thats what I want.

  7. #7
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by duc
    Thats what I want.
    Then use PHP's mail() function...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  8. #8

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by The Hobo
    Then use PHP's mail() function...
    I'm not sure how to use it. I'm very very new to html and php and I can't seem to find an example on google. sorry.

    -duc

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    PHP mail(): http://www.php.net/manual/en/function.mail.php

    You make a page (like mail.php) and have code found on the link above. Your form (on your .html page) points to mail.php.

    Code:
    <form action="mail.php" method="post">
        <b>Name</b>: <input type="name" name="username" /><br />
        <b>Message</b>:<br />
        <textarea name="message" rows="5" cols="20"></textarea><br />
        <input type="submit" name="submit" value="Send" />
    </form>
    Then, when the form is submitted, it will send the information to the PHP script as:

    Code:
    $_POST['username']; // this is the username field from the form
    $_POST['message']; // this is the message field from the form
    My evil laugh has a squeak in it.

    kristopherwilson.com

  10. #10

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    My html form:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .texta {
    font-size: 10px;
    background-color: #CCCCCC;
    border: 1px solid #666666;
    }


    -->
    </style>
    <link href=texta.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style3 {
    font-family: Verdana;
    font-size: x-small;
    }
    body {
    background-color: #990000;
    }
    -->
    </style>
    </head>

    <body><form action="mail.php" method="post">
    <span class="style1"><strong><span class="style3">Email</span>: </strong></span>
    <input name="username" type="name" class="texta" />
    <br />
    <span class="style1 style3"><b>Message</b>:</span><br />
    <textarea name="message" cols="90" rows="15" class="texta"></textarea>
    <br />
    <input type="submit" name="submit" value="Send" />

    </form>
    </body>
    </html>
    My PHP form:

    PHP Code:
    <?php
    mail
    ("[email protected]""My Subject""Line 1\nLine 2\nLine 3");
    ?>

  11. #11

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    I'm confused. Forget it. :P

  12. #12
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Dude...what are you confused about? If you can't figure this out, you really have no hope as a programmer. It's a basic concept.

    Try asking questions. That's usually how one learns.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  13. #13

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by The Hobo
    Dude...what are you confused about? If you can't figure this out, you really have no hope as a programmer. It's a basic concept.

    Try asking questions. That's usually how one learns.
    Not planning on being a programmer. If you read my other threads I said I'm more into Graphic Design. Programmning is just a side thing.

    Now that we got that out of the way,

    I'm not sure where to put what code where and on what page.


    -duc

  14. #14
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by duc
    Not planning on being a programmer.
    Oh, so that's why you're on these forums...


    Originally posted by duc
    If you read my other threads I said I'm more into Graphic Design. Programmning is just a side thing.
    I don't follow you around and read all your threads.

    Originally posted by duc
    I'm not sure where to put what code where and on what page.
    I'm sure someone can help you, unless you've totally given up.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width