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.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 11-20-2010, 06:43 AM
gurusofit gurusofit is offline
Banned
 
Join Date: 07-24-10
Posts: 42
iTrader: 0 / 0%
Post Any one know SMTP and PHP integration?

hi there

i want to know that how can i fulfill that requirement for my website that if some one sends me an email then he will automatically get an email of his email address that your request is received we will contact u soon.

i know for this two things are required PHP and SMTP
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 11-20-2010, 10:35 AM
mankis mankis is offline
Member
 
Join Date: 11-15-10
Location: Croatia
Posts: 48
iTrader: 0 / 0%
Why can't you add autoresponder to your e-mail account in your control panel? Am i missing something?
 
Reply With Quote
  #3  
Old 11-26-2010, 12:24 PM
gurusofit gurusofit is offline
Banned
 
Join Date: 07-24-10
Posts: 42
iTrader: 0 / 0%
@mankis , i just want to integrate SMTP, it will work for in other projects aswell, so i dont want to use cpanel autoresponder
 
Reply With Quote
  #4  
Old 11-27-2010, 05:41 AM
duche's Avatar
duche duche is offline
Contributing Member
 
Join Date: 11-10-10
Location: Los Angeles, CA
Posts: 96
iTrader: 0 / 0%
Thumbs up PHP Mail

You should check out the php mail() function.

Here is a example:
PHP Code:
 <?php
$to      
'nobody@example.com';
$subject 'the subject';
$message 'Thank you.  We have received your email.';
$headers  'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
$headers .= 'From: [email]webmaster@example.com[/email]' "\r\n" .
    
'Reply-To: [email]webmaster@example.com[/email]' "\r\n" .
    
'X-Mailer: PHP/' phpversion();

mail($to$subject$message$headers);
?>
If you want to include html tags in your email, you must ensure that you have the content-type html specified.

Last edited by HTMLBasicTutor; 11-27-2010 at 02:45 PM.
 
Reply With Quote
  #5  
Old 11-30-2010, 07:09 AM
exit44 exit44 is offline
Contributing Member
 
Join Date: 11-28-10
Location: Cleveland, Ohio
Posts: 53
iTrader: 0 / 0%
You can use PEAR to send it through an email account. Here is some example code for that:

PHP Code:
<?php
require_once "Mail.php";

$from "Web Master <webmaster@example.com>";
$to "Nobody <nobody@example.com>";
$subject "Test email using PHP SMTP\r\n\r\n";
$body "This is a test email message";

$host "mail.emailserver.com";
$username "webmaster@example.com";
$password "yourPassword";

$headers = array ('From' => $from,
  
'To' => $to,
  
'Subject' => $subject);
$smtp Mail::factory('smtp',
  array (
'host' => $host,
    
'auth' => true,
    
'username' => $username,
    
'password' => $password));

$mail $smtp->send($to$headers$body);

if (
PEAR::isError($mail)) {
  echo(
"<p>" $mail->getMessage() . "</p>");
} else {
  echo(
"<p>Message successfully sent!</p>");
}
?>
 
Reply With Quote
  #6  
Old 11-30-2010, 04:58 PM
duche's Avatar
duche duche is offline
Contributing Member
 
Join Date: 11-10-10
Location: Los Angeles, CA
Posts: 96
iTrader: 0 / 0%
I'm not sure if most hosting companies have PEAR implemented... Would probably need to verify this prior to attempting to use it.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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
Facebook tab integration jennycarol25 Social Network Marketing 6 11-10-2010 05:47 PM
Blog Integration baxy Blogging Forum 1 12-02-2008 11:23 PM
RSS integration into Wordpress graham_h Blogging Forum 1 08-14-2007 08:22 AM
Best adsense integration.. kiviniar Contextual Networks 15 09-15-2006 01:51 PM


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


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