How can I send an email through my website server. Like through a SMTP server I already have? Thx. I know that was general.
Printable View
How can I send an email through my website server. Like through a SMTP server I already have? Thx. I know that was general.
Use the PHP mail() function.
Or do you want to set up Outlook Express to do that for you?
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.Quote:
Originally posted by mendhak
Use the PHP mail() function.
-duc :wave:
Quote:
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 :wave:
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. ;)Quote:
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.
Then use PHP's mail() function...Quote:
Originally posted by duc
Thats what I want. ;)
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.Quote:
Originally posted by The Hobo
Then use PHP's mail() function...
-duc
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.
Then, when the form is submitted, it will send the information to the PHP script as: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>
Code:$_POST['username']; // this is the username field from the form
$_POST['message']; // this is the message field from the form
My html form:
My PHP form:Quote:
<!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>
I'm confused. Forget it. :P
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.Quote:
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.
Now that we got that out of the way,
I'm not sure where to put what code where and on what page.
-duc
Oh, so that's why you're on these forums...Quote:
Originally posted by duc
Not planning on being a programmer.
I don't follow you around and read all your threads.Quote:
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'm sure someone can help you, unless you've totally given up.Quote:
Originally posted by duc
I'm not sure where to put what code where and on what page.