Current location: Hot Scripts Forums » Programming Languages » PHP » how do i work with PHP mail() function


how do i work with PHP mail() function

Reply
  #1 (permalink)  
Old 06-28-03, 09:05 PM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
how do i work with PHP mail() function

hi,

i got a script that emails the webmaster the log of their search engine but im new to php so i need to know how to use the sendmail function. now i know its like this:

mail()

but thats all.can someone help me.
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-29-03, 08:06 AM
ChristGuy ChristGuy is offline
Operations Support Develo
 
Join Date: Jun 2003
Location: Rivonia, South Africa
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
The manual page can be found here:
http://www.php.net/mail

basically
Mail($Recipient, $Subject, $Message, $ExtraHeaders);

PHP Code:

<?php

  $From 
"me@here.com";
  
$Recipient "john.doe@domain.com";
  
$Subject "Testing...";
  
$Message "This is a test message\n"
  
$Message .= "It's only a test...";

  
$ExtraHeaders 'Date: ' Date("r");
  
$ExtraHeaders .= 'From: ' $Sender;

  
Mail($Recipient$Subject$Message$ExtraHeaders) or
    Die(
"Error sending mail :(");
?>
Hope this helps...
__________________
Till We Meet Again...
Clifford W. Hansen
Aspivia (Pty) Ltd

"We Have Seen Strange Things Today!" Luke 5:26

Last edited by ChristGuy; 06-29-03 at 08:08 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-29-03, 10:02 AM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
yes it did. thx
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-30-09, 03:04 PM
esandra esandra is offline
Newbie Coder
 
Join Date: Aug 2009
Posts: 47
Thanks: 1
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ChristGuy View Post
The manual page can be found here:
PHP: mail - Manual

basically
Mail($Recipient, $Subject, $Message, $ExtraHeaders);

PHP Code:

<?php
  $From 
"me@here.com";
  
$Recipient "john.doe@domain.com";
  
$Subject "Testing...";
  
$Message "This is a test message\n"
  
$Message .= "It's only a test...";

  
$ExtraHeaders 'Date: ' Date("r");
  
$ExtraHeaders .= 'From: ' $Sender;

  
Mail($Recipient$Subject$Message$ExtraHeaders) or
    Die(
"Error sending mail :(");
?>
Hope this helps...
will this send the message just as it is?
if I use this, what are the things that I should consider/change/add to this script?
I'm in real need of this script but I have no idea how to make use of it

Last edited by esandra; 08-30-09 at 03:06 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-31-09, 10:14 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
1) will this send the message just as it is?
Yes, it will.

2) if I use this, what are the things that I should consider/change/add to this script?
I guess that would depend on what kind of changes or additions do you want to make. (??)

3) I'm in real need of this script but I have no idea how to make use of it
You can simply run it as-is, but you'll want to use different "$From" and "$Recipient" addresses, as well as different text for the message and subject.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-31-09, 06:11 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
"Will this work?" is best answered by trying it.

Be sure to change any email addresses first.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 10:50 AM
Open source PHP Mail Script jewellgr Website Reviews 1 08-18-03 04:30 PM
mail() function SmartBiz PHP 8 08-03-03 11:01 PM
PHP Don't work Henry PHP 4 07-22-03 03:36 AM
edit php in Squirrelmail jrcortrightiii PHP 1 07-10-03 03:08 PM


All times are GMT -5. The time now is 07:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.