Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > PHP
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 03-12-2008, 07:37 PM   #1 (permalink)
david.grymes
Recruit
 
Join Date: Mar 2008
Posts: 1
david.grymes is on a distinguished road
send email using php

using php, how do i send email using an external smtp server? Can sombody give me an example to play with?
__________________
david.grymes is offline   Reply With Quote
Old 03-12-2008, 10:58 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,398
sde is on a distinguished road
here's a sourceforge project: SourceForge.net: PHPMailer

and a tutorial here: :: PHP Mailer ::

usage sample taken from their site:
PHP Code:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host "smtp.example.com"// SMTP server
$mail->From "from@example.com";
$mail->AddAddress("myfriend@example.net");

$mail->Subject "First PHPMailer Message";
$mail->Body "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap 50;

if(!
$mail->Send())
{
   echo 
'Message was not sent.';
   echo 
'Mailer error: ' $mail->ErrorInfo;
}
else
{
   echo 
'Message has been sent.';
}
?>
__________________
testing 1 2 3
sde is offline   Reply With Quote
Old 03-13-2008, 09:45 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,398
sde is on a distinguished road
let us know if that helps Salch.
__________________
testing 1 2 3
sde is offline   Reply With Quote
Old 03-14-2008, 09:38 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
It's like some sort of shape shifting ghost.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Enter Network Password" when trying to send email through IE dazz williams Windows 0 05-16-2007 10:46 AM
PHP 5.0.4 and 4.3.11 Released sde Code Newbie News 0 04-20-2005 10:56 AM
send email from server awieds MS Technologies ( ASP, VB, C#, .NET ) 1 04-04-2005 10:25 PM
Craigslist Anonymous Email Relay with PHP & MySQL? oc_earthling PHP 11 03-05-2005 08:10 AM
How to send multiple records from db to email address roexecom PHP 3 02-14-2005 10:39 PM


All times are GMT -8. The time now is 11:03 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle