FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Problem with attaching file (from a form) to email in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Problem with attaching file (from a form) to email in PHP [message #172780 is a reply to message #172756] Tue, 01 March 2011 00:58 Go to previous messageGo to previous message
Cameleon is currently offline  Cameleon
Messages: 7
Registered: February 2011
Karma:
Junior Member
Thanks Jerry... can I use variables, like I did below... it keeps
telling me invalid address??



=======

// MAIL SUBJECT
$subject = $_POST['Sujet'] . " from site xyz";
$subject = str_replace("\'", "'", $subject);


// MAIL ADDRESSES

$nom = str_replace("'", "''", $_POST['Nom']);
$NameFrom = $nom;
$EmailFrom = "<" . $_POST['Email'] . ">";

$NameTo = "Test User";
$EmailTo = "<Tests(at)xyz(dot)com>";



.....



require_once '../class.phpmailer.php';

$mail = new PHPMailer(true);



try {
$mail->AddReplyTo($EmailFrom, $NameFrom);
$mail->AddAddress($EmailTo, $NameTo);
$mail->SetFrom($EmailFrom, $NameFrom);
$mail->AddReplyTo($EmailFrom, $NameFrom);
$mail->Subject = $subject;
$mail->AltBody = $message;
$mail->MsgHTML(file_get_contents('message.html'));
$mail->AddAttachment($UploadedFile_name);
$mail->Send();
echo "Message Sent OK<p></p>\n";
}
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SOCIAL NETWORK FOR PHP PLATFORM..
Next Topic: HTML select field where the OPTION text is of different colors
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 04:28:18 GMT 2024

Total time taken to generate the page: 0.05475 seconds