Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php mail? 3

Status
Not open for further replies.

jefargrafx

Instructor
Joined
May 24, 2001
Messages
273
Location
US
I've been ask to write a script that will send an email message to a user account on an imap server.

I've look through the php manual without any help, I did find a simple example but when I try to run the example I get an error, smtp relay (smomething or other)

my question, where can I find a good turtorial on php mail with using imap that explain the mail backend as well.

I'm totally lost here?

any help

jef
 
AFAIK, IMAP is only used to retrieve mails, not send them.

//Daniel
 
okay that good to know,


so smpt will send the mail, if I have my php.ini setting for win32 (ei localhost)

is there anythign else I need to do to the server for smpt?

let me know

jef
 
okay Thanks...that help bunches, (not know squat about mail server)

I'm getting close now,

what's up with my statement below

been at it over 12 hours now and my brain is dead


<?php
mail( echo &quot;$HTTP_GET_VARS['full_name']&quot;, &quot;My Subject&quot;, &quot;Line 1\nLine 2\nLine 3&quot;);
?>


just want to get the email address from the pervious page?

let me know


jef
 
You are mixing up PHP and HTML.
To use a variable in PHP you need not echo it, just use the varname.
[code[
<?php
# wrong
mail( echo &quot;$HTTP_GET_VARS['full_name']&quot;, &quot;My Subject&quot;, &quot;Line 1\nLine 2\nLine 3&quot;);
# right
<?php
mail($HTTP_GET_VARS['full_name'], &quot;My Subject&quot;, &quot;Line 1\nLine 2\nLine 3&quot;);
?>
[/code]
?>
 
I don't know how PHP will behave with that invokation of &quot;echo&quot; inside your mail statement.

Why not:

Code:
<?php
mail( $HTTP_GET_VARS['full_name'], &quot;My Subject&quot;, &quot;Line 1\nLine 2\nLine 3&quot;);
?>

Or if your version of PHP is 4.1.0 or newer

Code:
<?php
mail( $_GET['full_name'], &quot;My Subject&quot;, &quot;Line 1\nLine 2\nLine 3&quot;);
?>


This will work provided that you enter an email address in the &quot;full_name&quot; field of your form. And it has to be just an email address, not something like &quot;Joe Blow <jblow@foo.com>&quot;

Have you read, by the way, the PHP online manual on mail()? (
Want the best answers? Ask the best questions: TANSTAAFL!!
 
yep!

that's the trick

works like a charm

now and can go forward and pass al the stuuf I need to in my script

thanks again for all yall help


jef
 
There's also some nice faq's about mail like this one faq434-2681

sleipnir, I may have to create a page in the very near future that will have to send results to an email address. Your post looks like it will help a lot.

I think you should get a star!
What do you think?

tgus

____________________________
Families can be together forever...
 
Should the day come that you want to send complex emails (HTML emails, attachments, etc.), check out PHPMailer:
PHPMailer's complex enough to be slightly daunting at first, but well worth the time to get to know it.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top