Using PHP to send mail [message #160401] |
Tue, 01 September 2009 16:32 |
wittrs
Messages: 134 Registered: August 2009
Karma: 0
|
Senior Member |
|
|
Does anyone have any idea how php could email a message for me? I already have script that gets into the mailbox, grabs each mail, and pipes it over to the maillist.php file. But I would also like each mail to be automatically mailed somewhere.
Any help out there?
(Let me explain the reason why. I'm trying to "wash" Yahoo ads out of our maillist. FudForum gets rid of the junk in the email. If I could only get the junk-free portion of the mail to be automatically sent to list members, I'd accomplish my goal. I could simply set their group subscriptions to "no mail" to avoid double-mails, and would be, instead, sending "washed" email to them. The group would benefit from not having to put up with the ads).
All I need is the syntax for simple send mail command
Thanks and regards.
|
|
|
|
|
Ynt: Re: Using PHP to send mail [message #186978 is a reply to message #166368] |
Thu, 08 October 2015 06:55 |
anilk123
Messages: 3 Registered: October 2015 Location: Turkey
Karma: 0
|
Junior Member |
|
|
Create and copy index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.yazilimdilleri.net</title>
</head>
<body>
<form action="mail.php" method="post">
İsminiz:<br/>
<input type="text" name="name"/><br/>
E-Posta adresiniz:<br/>
<input type="text" name="email"/><br/>
Konu:<br/>
<input type="text" name="subject"/><br/>
Mesajınız:</br>
<textarea name="message"></textarea><br/>
input type="submit" value="Gönder"/>
</form>
</body>
Createa and copy mail.php
if(isset($_[POST]['name']) && isset($_[POST]['email']) && isset($_[POST]['subject']) && isset($_[POST]['message']))
{
if(empty($_[POST]['name']) || empty($_[POST]['email']) || empty($_[POST]['subject']) || empty($_[POST]['message']))
{
echo "Lütfen formu tam doldurunuz";
}
else
{
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$subject = strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);
$icerik = 'İsim: ' .$name. '<br/>E-Mail: ' .$email. '<br/>'. $mesaj;
mail('iletisim(at)batuhanavlayan(dot)com', $subject, $icerik);
//your@site . com yerine mail hangi adrese gidecek ise o adresi yazıyoruz.
echo "Mesajınız başarı ile gönderildi.";
}
}
else
{
echo 'Lütfen Formu Doldurun';
}
Its mee
|
|
|