Page 1 of 1

Send mail name problem in invite and import

Posted: Sun Nov 04, 2007 8:49 am
by aryan3
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi 

i am using gmail invite and import script and its working fine but when i send email from it its showing email name as UNKNOWN SENDER. 
i dont know how to configure i am showing you script and mail which i receive i am not friendly with php but can manage. 

Here is script 

[color=red]***** PLEASE USE TAGS WHEN POSTING CODE *****[/color]

Code: Select all

<?php
/*
 * AddressBookImport.com is a PHP-Gmail gateway. It will allow you to
 * retrieve your contacts from Gmail Server using PHP and cURL Libraries.
 *
 * Created by: AddressBookImport.com <info@addressbookimport.com>, November 01, 2005
 *
 * This program is trial version of this script. The script can be purchased at
 * http://www.AddressBookImport.com
 */


$sMessage = '
join me @ the new virtual community @ mydomainname.com.<br>
create your free custom profile with unlimited pictures,<br>
rate other members, message other members, watch music videos,<br>
listen to online radio streams and more.<br>
Register today FREE @ http://www.mydomianname.com<br>
';

$sSubject = "Join me at MyDomain.com";
$sFromEmailName = "mydomain.com";
$sFromEmail = "invite@mydomain.com";



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="AddressBookImport.com">
<head>
<title>Gmail Address Book Import Script - AddressBookImport - Address Book Import Script for Yahoo, Hotmail, Gmail, AOL and more</title>
<meta name="keywords" content="AddressBookImport, addressbook, import, script, grabber, addressbook grabber, addressbook import script, php, curl" />
<meta name="description" content="AddressBookImport - Address Book Import Script for Yahoo, Hotmail, Gmail, AOL and more" />
<meta name="author" content="AddressBookImport.com" />
</head>
<body bgcolor=#FFFFFF leftmargin=0 topmargin=5 marginwidth=0 marginheight=0>
<br>
<h3 align=center>Gmail AddressBookImport Script - http://www.AddressBookImport.com</h3><hr size=1><br>

	<table border=0 cellspacing=0 cellpadding=1 width="50%" align=center>
	<form method="post" action="<?= $_SERVER['SCRIPT_NAME']; ?>">
	<tr>
	 <td width="120"><img src="http://www.AddressBookImport.com/images/invite/gmail.gif"></td>
	 <td>Gmail Email Address:<br /><input type="text" class="form1" name="emailaddress"></td>
	 <td>Gmail Password:<br /><input type="password" class="form1" name="password"></td><td><br /><input type="submit" class="form1" value="Submit"></td>
	</tr>
	</form>
	</table>

<div align=center>

<?php
if ($_SERVER["CONTENT_LENGTH"] > 0)
{
    $sAction = fnGet("action");

    if ($sAction == "sendemails")
    {
        // Send the Email Addresses
    	$num = fnGet("i");
	    $sEmailAddress = fnGet("fromname");

	    for ($i=0; $i < $num; $i++)
	    {
		    $sName = fnGet("name" . $i);
		    $sEmail = fnGet("email" . $i);
		    $sCheck = fnGet("check" . $i);

    		if ($sCheck == "on")
	    	{

          		$headers  = 'MIME-Version: 1.0' . "\r\n";
          		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

          		// Additional headers
          		$headers .= 'To: ' . $sName . ' <' . $sEmail . '>' . "\r\n";
          		$headers .= 'From: ' . $sFromEmailName . ' <' . $sFromEmail . '>' . "\r\n";

        		// Mail it
        		$bMailReturn = mail($sEmail, $sSubject, $sMessage, $headers);
        		if ($bMailReturn == true)
        			print('Message sent to ' . $sEmail . '<br>');
		    }
	    }
    }
    else
    {
        $varURL = "http://www.AddressBookImport.com/trial/";

        $params = "service=Gmail&emailaddress=" . fnGet("emailaddress") . "&password=" . fnGet("password");

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        curl_setopt($ch, CURLOPT_URL,$varURL);
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        $content = curl_exec ($ch);

        if (strpos($content, "~Invalid Login~") !== false)
  		    print('<br><br><div align=center>... INVALID LOGIN ...</div>');
  	    else
  	    {
  	        print('
                <form method="post" action="gmail.php">
                <div align=center><br><br>Select the Contacts you want to send invite to:<br/></div>
                <table border=0 cellspacing=0 cellpadding=3 width="40%" align=center>');

            $content = str_replace('<!-- -->', '', $content);

            $sList = explode("\n", $content);

            for ($i=0; $i < count($sList)-1; $i++)
            {
                $sList2 = explode(",", $sList[$i]);
                print('<tr><td width="10" align=center><input type="checkbox" id="check' . $i . '" name="check' . $i . '" checked></td><td><input type="text" size="30" name="name' . $i . '" value="' . $sList2[0] . '"></td><td><input type="text" size="30" name="email' . $i . '" value="' . $sList2[1] . '"></td></tr>');
            }

            print('
            </table>
            <br /><br />
            <div align=center><input type="submit" value="Send Invite"></div>
            <input type="hidden" name="action" value="sendemails">
            <input type="hidden" name="i" value="' . $i . '">
            <input type="hidden" name="fromname" value="' . fnGet("emailaddress") . '">
            </form>
            ');
        }
    }
}


function fnGet($varQuery, $varType = "AUTO")
{
    if ($varType == "AUTO")
    {
    	if (isset($_GET["$varQuery"]))
        {
    		return($_GET["$varQuery"]);
        }
    	elseif (isset($_POST["$varQuery"]))
        {
    		return($_POST["$varQuery"]);
        }
    }
    elseif ($varType == "GET")
    {
    	if (isset($_GET["$varQuery"]))
        {
    		return($_GET["$varQuery"]);
        }
    }
    elseif ($varType == "POST")
    {
    	if (isset($_POST["$varQuery"]))
        {
    		return($_POST["$varQuery"]);
        }
    }

    return("");
}

?>
</div>
</body>
</html>
AND THIS IS WHAT I GET WHEN I IVITE SOMEONE
----------------------------------------------------------------------------------------------------------

Code: Select all

(unknown sender) <>    hide details  3:14 pm (1 hour ago)  
 to  ************@gmail.com   
 date  4 Nov 2007 07:14:51 -0600   

Content-type: text/html; charset=iso-8859-1

To: XYZ <************@gmail.com>
From: <>


join me @ the new virtual community @ mydomainname.com.<br>
create your free custom profile with unlimited pictures,<br>
rate other members, message other members, watch music videos,<br>
listen to online radio streams and more.<br>
Register today FREE @ http://www.mydomianname.com<br>



but if i use this script

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>iTell from urQuiz</title>
<style type="text/css">
<!--
.style2 {font-size: 12px}
-->
</style>
</head>
<body>
<form action="<? echo $_POST['self']; ?>" method="post"> Your Name : <br />
<input name="name" type="text"><br />Friend's Email Address : <br />
<input name="email" type="text"><br />
<input name="Send" type="submit" value="Send">
</form>
<?

if (@$_POST['Send']=="Send")
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject = $name. " wants you to visit this site, its cool!";
//This is the body section of the email and can be substituted for your message
$message= "Hi, \n\n" .$name. " thinks you might like to visit our website : \n\n http://www.yourdomain.co.uk \n\n\n\n\n\n\n\nNote: This message was not sent unsolicited.  It was sent through a form located at http://www.yourdomain.co.uk If you believe this message was received on error, please disregard it.";
$headers = 'From: webmaster@yourdomain.co.uk' . "\r\n" . 'Reply-To: webmaster@yourdomain.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($email, $subject, $message, $headers); 
echo "You`ve recommended our site to: $email  Thanks you";
}
?>
<br />
<br />

<? // Please dont remove the following Links. They are there to keep our scripts free  ?>
<span class="style2"><a href="http://www.urquiz.co.uk/itell">iTell</a> from urQuiz <a href="http://www.urquiz.co.uk">Instant win games </a></span><br />
</body>

</html>
THIS IS WHAT I GET

Code: Select all

webmaster@yourdomain.co.uk" <webmaster@yourdomain.co.uk>    hide details  2:41 pm (2 hours ago)  
 reply-to  webmaster@yourdomain.co.uk   
 to  infocomsolutions@gmail.com   
 date  4 Nov 2007 06:41:40 -0600   
 subject  aryan wants you to visit this site, its cool!
Hi,

aryan thinks you might like to visit our website :

http://www.yourdomain.co.uk



Note: This message was not sent unsolicited. It was sent through a form located at http://www.yourdomain.co.uk If you believe this message was received on error, please disregard it.


I WANT MY ABOVE SCRIPT LIKE THIS .........


thanks in advance for your help i dont know which variable i change i already change mydomain.com with my domain but it dont work i want when someone import his contact and send invite the who get email can see his friend name as sender and also in subject like second script is doing..


Thanks again in advance


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]