It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

sending mails - problem

Moderator: Malcolm

sending mails - problem

Postby nighthawk on Tue Jul 18, 2006 7:51 pm

Code: Select all
$mailcontent = 'name'.$name."\n".
                 'sender'.$sender."\n". 
            'subject'.$subject."\n".
            'text'."\n".$tekst."\n";


this doesn't work properly. It sends mail but all the content is in message's head, there is nothing in body.
It suppose to send mail to me from a web site (html imput forms) and this part works well.

What is the problem here?
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ

Postby grommit on Fri Jul 21, 2006 4:02 pm

Could you pls post the whole code...
grommit
 
Posts: 28
Joined: Thu Jun 29, 2006 11:29 am
Location: Netherlands

Postby nighthawk on Sat Jul 22, 2006 8:02 pm

Code: Select all
$from = 'from: newuser@sajt.com';

mail ( $toaddress,  $mailcontent, $from);


here is the rest of code.

Could my error be in this last line? Maybe I second argument should be subject, not mailcontent?
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ

Postby mwa103 on Mon Jul 24, 2006 1:35 pm

I think you just need to add a subject between to & mailcontent. You can check out php.net for the propper use of mail function.

http://us2.php.net/manual/en/function.mail.php

When I do email I usually put it together like this.

$to = "them@wherever.com";
$subject = "Your Subject";
$headers = 'From: Your email or name';
$message = "Type message here."
$sent = mail($to, $subject, $message, $headers);

Hope this helps.
-Mike
mwa103
100+ Club
 
Posts: 206
Joined: Mon Mar 07, 2005 10:55 pm

Postby nighthawk on Mon Jul 24, 2006 7:58 pm

This helped me, thanks
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ


Who is online

Users browsing this forum: No registered users and 1 guest