Author Topic: (unknown sender) (no subject)  (Read 826 times)

0 Members and 1 Guest are viewing this topic.

Offline ym_chaituTopic starter

  • Devotee
  • Posts: 652
  • Gender: Male
  • visit http://drvirusindia.com
    • View Profile
    • DrVirus
(unknown sender) (no subject)
« on: March 18, 2010, 01:39:17 AM »
hai
 Using this below code, i have made one application which will send the users with the name as (unknown sender)
and the subject line will the (no subject),
can any one explain me why is this happening??
Seeing this can i think that i can hide my real name and things without authentication using PHP

<?php
require_once "Mail.php";

$from "Support <[email]email@email.com[/email]>";
$to "Chaitu <[email]myid@gmail.com[/email]>";
$subject "Hi!";
$body "<h1>Hi</h1>,\n\nHow are you?";


$host "mail.example.com";
$username "smtp_username";
$password "smtp_password";
$headers  'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";

// Additional headers
$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>");
 }
?>


by the way i forgot to tell.
the smtp details i have intentionally removed them from here..  :P
« Last Edit: March 18, 2010, 01:40:05 AM by ym_chaitu »
Quote
Chaitanya Babu Yanamadala
http://drvirusindia.com
http://li8teesko.com