Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 08-04-2015, 01:44 AM
Suniel's Avatar
Suniel Suniel is offline
Contributing Member
 
Join Date: 07-25-15
Location: Mumbai
Posts: 94
iTrader: 0 / 0%
Need Email Coding for PHP

Can Anyone Share PHP coding for Email Sending. I am In Hurry!
 

Advertisement

Advertisement

  #2  
Old 08-04-2015, 03:48 AM
kontrol's Avatar
kontrol kontrol is offline
Contributing Member
 
Join Date: 02-10-10
Posts: 225
iTrader: 0 / 0%
$rec = // receiver's email
$sub = // subject
$head = // sender's email
$msg = // the message

mail($rec, $sub, $msg, $head) or die ("Error");
i hope u find it useful
 
  #3  
Old 08-19-2015, 02:34 AM
seohongkong seohongkong is offline
Junior Member
 
Join Date: 08-19-15
Location: Hong Kong
Posts: 6
iTrader: 0 / 0%
Do you have using any php framework ?
PHP has a very simple mail function which is used very often for basic text mail messages. What if you need to attach files or if you need to send your e-mail messages via SMTP? Than it’s time to use a more advanced script. This is because the standard mail function has only limited standard capabilities.
 
  #4  
Old 09-09-2015, 05:27 AM
Harr's Avatar
Harr Harr is offline
Junior Member
 
Join Date: 07-30-15
Posts: 48
iTrader: 0 / 0%
why don't you first try to code and when you get stuck we can help you.
 
  #5  
Old 09-18-2015, 02:15 PM
voodooKobra's Avatar
voodooKobra voodooKobra is offline
Contributing Member
 
Join Date: 09-04-13
Location: Florida
Posts: 79
iTrader: 0 / 0%
You mean something like this? (Warning: I wrote this code in 2011, it's uglier than sin.)
 
  #6  
Old 09-23-2015, 12:15 AM
granite granite is offline
Junior Member
 
Join Date: 09-17-15
Posts: 10
iTrader: 0 / 0%
You can try PHPMailer, it includes examples on the site too. Hope this help you
 
  #7  
Old 11-03-2015, 01:15 AM
webpark webpark is offline
Contributing Member
 
Join Date: 06-02-11
Posts: 56
iTrader: 0 / 0%
+1 for phpmailer, the best thing for standard SMTP configuration.
 
  #8  
Old 11-18-2015, 08:59 PM
candyman candyman is offline
Contributing Member
 
Join Date: 11-18-15
Posts: 106
iTrader: 0 / 0%
phpmailer is the best option
 
  #9  
Old 11-20-2015, 10:39 AM
J. H. Rasmussen J. H. Rasmussen is offline
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,997
iTrader: 1 / 100%
Quote:
Originally Posted by candyman View Post
phpmailer is the best option
Why is phpmailer the best option for OP? Features, price, usability etc.?
 
  #10  
Old 11-22-2015, 02:03 AM
candyman candyman is offline
Contributing Member
 
Join Date: 11-18-15
Posts: 106
iTrader: 0 / 0%
phpmailer is open source and free to use.Has integrated SMTP support, alternative emails for mail clients that do not read HTML email etc. I have used it extensively in my projects and is easy to configure.
 
  #11  
Old 12-04-2015, 03:54 AM
johanhns johanhns is offline
Contributing Member
 
Join Date: 05-24-15
Posts: 55
iTrader: 0 / 0%
PHP Code:
<?php
//if "email" variable is filled out, send email
  
if (isset($_REQUEST['email']))  {
  
  
//Email information
  
$admin_email "someone@example.com";
  
$email $_REQUEST['email'];
  
$subject $_REQUEST['subject'];
  
$comment $_REQUEST['comment'];
  
  
//send email
  
mail($admin_email"$subject"$comment"From:" $email);
  
  
//Email response
  
echo "Thank you for contacting us!";
  }
  
  
//if "email" variable is not filled out, display the form
  
else  {
?>

 <form method="post">
  Email: <input name="email" type="text" /><br />
  Subject: <input name="subject" type="text" /><br />
  Message:<br />
  <textarea name="comment" rows="15" cols="40"></textarea><br />
  <input type="submit" value="Submit" />
  </form>
  
<?php
  
}
?>
 
  #12  
Old 12-13-2015, 10:46 PM
mehreenshaikh mehreenshaikh is offline
Banned
 
Join Date: 11-26-15
Location: Ahemdabad
Posts: 44
iTrader: 0 / 0%
Need Email Coding for PHP

Hello

PHP Email Code -

PHP Code:
<?php
//if "email" variable is filled out, send email
  
if (isset($_REQUEST['email']))  {
  
  
//Email information
  
$admin_email "someone@example.com";
  
$email $_REQUEST['email'];
  
$subject $_REQUEST['subject'];
  
$comment $_REQUEST['comment'];
  
  
//send email
  
mail($admin_email"$subject"$comment"From:" $email);
  
  
//Email response
  
echo "Thank you for contacting us!";
  }
  
  
//if "email" variable is not filled out, display the form
  
else  {
?>

 <form method="post">
  Email: <input name="email" type="text" /><br />
  Subject: <input name="subject" type="text" /><br />
  Message:<br />
  <textarea name="comment" rows="15" cols="40"></textarea><br />
  <input type="submit" value="Submit" />
  </form>
  
<?php
  
}
?>

Last edited by ScriptMan; 12-14-2015 at 05:18 AM.
 
  #13  
Old 12-14-2015, 03:50 AM
Dan Williamson Dan Williamson is offline
The Controversial Coder
 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,710
iTrader: 0 / 0%
Quote:
Originally Posted by mehreenshaikh View Post
Hello

PHP Email Code -
You could at least credit where you go this code:

http://www.inmotionhosting.com/suppo...to-send-emails

You should also note the bold text below:

Quote:
Keep in mind, this is a basic tutorial to explain how to use the mail() function in PHP. Using the method, exactly the way it is, can be insecure and should not be used on your website. This tutorial is aiming to provide you the basic of how to use phpmail() and for further use, you may want to look into securing your code to possible hacks.
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Coding in PHP - Please help! jjfletcher90 Coding Forum 12 07-24-2011 06:45 PM
Email blast HTML coding for images How to make them pop up. jpf566 Web Design Lobby 5 08-21-2008 02:59 AM
php coding, java coding, webdesign, windows coding... SVB SEO Forum 5 02-24-2004 11:25 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:36 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC