1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help from the forum please

Discussion in 'BlackHat Lounge' started by antx16, Jan 10, 2009.

  1. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    Guys i need help please i am tearing my hair out, i have a website called yourdomain.com, and when somebody books something they should recieve back an confirmation email from
    , but this does not happen they recieve
    , if you reply back to that email it bouces back, for info the domain is hosted at dreamhost and using gmail for email from within the dreamhost cpanel, any ideas will be great
     
  2. yeti_racer

    yeti_racer Junior Member Premium Member

    Joined:
    Dec 3, 2008
    Messages:
    192
    Likes Received:
    87
    Location:
    Hick Ville
    Sounds to me like something is setup wrong in whatever script you are using for the bookings. Gmail also has a "send mail as" that you can use if you are the one sending the mails. settings > accounts > send mail as

    Is the username for the account travel? Looks like the mail is going out as user@server instead of user@yourdomain. So probably some sort of oddity with your installed script. There should be a way to set a reply to address though.
     
  3. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    that what i thought it is a simple sendmail script that sends back a confirmation receipt, travel has nothing to do with the site

    Code:
    function setHeaders()
    	{
    		$this->headers	= 'MIME-Version: 1.0' . "\r\n";
    		$this->headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    		$this->headers .= "From: Travel site";
    
    do you think the problem is here
     
    Last edited: Jan 10, 2009
  4. zone69

    zone69 Junior Member

    Joined:
    Nov 24, 2008
    Messages:
    196
    Likes Received:
    1,290
    Do the headers include a Reply To: header?

    Try to add this:
    Code:
    this->headers .='Reply-To: bookings@yourdomain.com'."\r\n";
    
    Also change the From: header to something like this:
    Code:
    this->headers .='From: gmailuser@gmail.com'."\r\n";
    
    btw, i think the travel is coming from the From header. it is in double quotes so I believe you need to escape the space so its likely just grabbing the Travel.

    Hope that works for you
     
    Last edited: Jan 10, 2009
  5. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    This is the whole script i dont program php so all help is apreciated

    Code:
    <?php
    /*
     *
     * General mailing framework
     *
     */
    
    class Mail
    {
    	var $emailId;
    	
    	var $name;
    	
    	var $contact;
    	
    	var $message;
    	
    	var $to;
    	
    	var $subject;
    	
    	var $headers;
    	
    	function Mail($credentials) 
    	{
    		$this->__construct($credentials);
    	}
    	
    	function __construct($credentials) 
    	{
    		$this->emailId	= $credentials['email'];
    		$this->name		= $credentials['name'];
    		$this->contact	= $credentials['contact'];
    		$this->subject	= $credentials['subject'];
    		$this->setMessage($credentials);
    		$this->to		= $credentials['to'];
    		$this->setHeaders();
    	}
    	
    	function sendMail()
    	{
    		mail($this->to, $this->subject, $this->message, $this->headers);
    	}
    	
    	function setHeaders()
    	{
    		$this->headers	= 'MIME-Version: 1.0' . "\r\n";
    		$this->headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    		$this->headers .= "From: Travel site";
    	}
    	
    	function setMessage($credentials)
    	{
    		$this->message = "<style>
    							<!--
    							 /* Font Definitions */
    							 @font-face
    								{font-family:'Cambria Math';
    								panose-1:2 4 5 3 5 4 6 3 2 4;
    								mso-font-charset:1;
    								mso-generic-font-family:roman;
    								mso-font-format:other;
    								mso-font-pitch:variable;
    								mso-font-signature:0 0 0 0 0 0;}
    							@font-face
    								{font-family:Calibri;
    								panose-1:2 15 5 2 2 2 4 3 2 4;
    								mso-font-charset:0;
    								mso-generic-font-family:swiss;
    								mso-font-pitch:variable;
    								mso-font-signature:-1610611985 1073750139 0 0 159 0;}
    							@font-face
    								{font-family:Tahoma;
    								panose-1:2 11 6 4 3 5 4 4 2 4;
    								mso-font-charset:0;
    								mso-generic-font-family:swiss;
    								mso-font-pitch:variable;
    								mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
    							 /* Style Definitions */
    							 p.MsoNormal, li.MsoNormal, div.MsoNormal
    								{mso-style-unhide:no;
    								mso-style-qformat:yes;
    								mso-style-parent:'';
    								margin:0in;
    								margin-bottom:.0001pt;
    								mso-pagination:widow-orphan;
    								font-size:12.0pt;
    								font-family:'Times New Roman','serif';
    								mso-fareast-font-family:Calibri;
    								mso-fareast-theme-font:minor-latin;}
    							a:link, span.MsoHyperlink
    								{mso-style-priority:99;
    								color:blue;
    								text-decoration:underline;
    								text-underline:single;}
    							a:visited, span.MsoHyperlinkFollowed
    								{mso-style-noshow:yes;
    								mso-style-priority:99;
    								color:purple;
    								text-decoration:underline;
    								text-underline:single;}
    							span.EmailStyle17
    								{mso-style-type:personal;
    								mso-style-noshow:yes;
    								mso-style-unhide:no;
    								font-family:'Calibri','sans-serif';
    								mso-ascii-font-family:Calibri;
    								mso-hansi-font-family:Calibri;
    								color:#1F497D;}
    							span.EmailStyle18
    								{mso-style-type:personal;
    								mso-style-noshow:yes;
    								mso-style-unhide:no;
    								font-family:'Calibri','sans-serif';
    								mso-ascii-font-family:Calibri;
    								mso-hansi-font-family:Calibri;
    								color:#1F497D;}
    							.MsoChpDefault
    								{mso-style-type:export-only;
    								mso-default-props:yes;
    								font-size:10.0pt;
    								mso-ansi-font-size:10.0pt;
    								mso-bidi-font-size:10.0pt;}
    							@page Section1
    								{size:8.5in 11.0in;
    								margin:1.0in 1.0in 1.0in 1.0in;
    								mso-header-margin:.5in;
    								mso-footer-margin:.5in;
    								mso-paper-source:0;}
    							div.Section1
    								{page:Section1;}
    							-->
    							</style>
    							<!--[if gte mso 10]>
    							<style>
    							 /* Style Definitions */
    							 table.MsoNormalTable
    								{mso-style-name:'Table Normal';
    								mso-tstyle-rowband-size:0;
    								mso-tstyle-colband-size:0;
    								mso-style-noshow:yes;
    								mso-style-priority:99;
    								mso-style-qformat:yes;
    								mso-style-parent:'';
    								mso-padding-alt:0in 5.4pt 0in 5.4pt;
    								mso-para-margin:0in;
    								mso-para-margin-bottom:.0001pt;
    								mso-pagination:widow-orphan;
    								font-size:10.0pt;
    								font-family:'Times New Roman','serif'}
    							</style>
    							<![endif]-->";
    		
    		$this->message .= "<table class=MsoNormalTable border=1 cellspacing=1 cellpadding=0 width=500
    						 style='width:375.0pt;mso-cellspacing:.7pt;background:#CCCCCC;mso-yfti-tbllook:
    						 1184;mso-padding-alt:0in 0in 0in 0in'>
    						 
    						  <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes' align='center'>
    							<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt' colspan='2'><img src='http://" . 
    								($_SERVER['HTTP_HOST']) . "/images/faixa.jpg' />
    							</td>
    						 </tr>
    		
    						 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes' align='center'>
    							<td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt' colspan='2'><h3>" . $this->subject . "</h3>
    							</td>
    						 </tr>
    						 
    						 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
    						  <td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Name:<o:p></o:p></span></b></p>
    						  </td>
    						  <td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->name . "<o:p></o:p></span></p>
    						  </td>
    						 </tr>
    						 
    						 <tr style='mso-yfti-irow:2'>
    						  <td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Contact:<o:p></o:p></span></b></p>
    						  </td>
    						  <td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->contact . "<o:p></o:p></span></p>
    						  </td>
    						 </tr>
    						 
    						 <tr style='mso-yfti-irow:2'>
    						  <td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Email:<o:p></o:p></span></b></p>
    						  </td>
    						  <td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $this->emailId . "<o:p></o:p></span></p>
    						  </td>
    						 </tr>
    						 
    						 <tr style='mso-yfti-irow:2'>
    						  <td style='background:#EEEEEE;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><b><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>Message:<o:p></o:p></span></b></p>
    						  </td>
    						  <td style='background:white;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
    						  <p class=MsoNormal><span style='font-size:8.0pt;font-family:\"Tahoma\",\"sans-serif\"'>" . $credentials['message'] . "<o:p></o:p></span></p>
    						  </td>
    						 </tr>
    						 </table>";
    	}
    }
    
    ?>
     
  6. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    just tried that thanks but no luck i am really not understanding why this is happening
     
  7. zone69

    zone69 Junior Member

    Joined:
    Nov 24, 2008
    Messages:
    196
    Likes Received:
    1,290
    Ok so try to change this:

    Code:
    function setHeaders()
    	{
    		$this->headers	= 'MIME-Version: 1.0' . "\r\n";
    		$this->headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    		$this->headers .= "From: Travel site";
    	}
    
    To:
    Code:
    function setHeaders()
    	{
    		$this->headers	= 'MIME-Version: 1.0' . "\r\n";
    		$this->headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                    $this->headers .= 'Reply-To: bookings@yourdomain.com'."\r\n";
    		$this->headers .= 'From: bookings@yourdomain.com'."\r\n";
    	}
    
    EDIT: just saw your last post so I guess this won't work. maybe try just adding only the REPLY TO: header and not changing the FROM: header?
     
    Last edited: Jan 10, 2009
  8. 19w08

    19w08 Guest

    Hi antx16

    Well your php code is just fine, its only for sending your booking.

    Problem is within your email set up at your cpanel
     
  9. 19w08

    19w08 Guest

    That should do the trick zone69!

    Nice one
     
  10. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    cheers for all your help guys give me 5 minutes and i will get back to let you know how it goes
     
  11. zone69

    zone69 Junior Member

    Joined:
    Nov 24, 2008
    Messages:
    196
    Likes Received:
    1,290
    unfortunately I don't have cpanel on any of my servers so really have no clue what changes you can make there.
     
  12. 19w08

    19w08 Guest

    Kinda meant your email setup etc. :)

    In cpanel its a piece of cake to add emailadresses etc.
     
  13. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    yep well still cant figure it out it has to something so stupid , i went all dreamhost cpanel and nothing to do in there , i mean it replies fine info is ok but return email address is not mine it looks like it is dreamhosts server replying, it was doing the same when hosted directly from dreamhost mailservers so i thought change to gmail apps hosting , but still the same
     
  14. 19w08

    19w08 Guest

    Its always something stupid hehe...

    Can you work around the problem when using the autoresponder in your cpanel with bookings*yourdomain.com ?
     
  15. zone69

    zone69 Junior Member

    Joined:
    Nov 24, 2008
    Messages:
    196
    Likes Received:
    1,290
    That's very weird. I agree it will be something stupid.

    As a simple test try create a file called test.php in your webroot like this and then just access it with hxxp://yourdomain.com/test.php and check the email you receive to see what the reply-to is. :

    Code:
    <?php
    $to = "yourid@domain.com";              //an email address you can receive mail to
    $subject = "Just a test mail";
    $message = "Just a test mail message";
    $from = "bookings@domain.com";
    
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "To: ".$to."\r\n";
    $headers .= "From: ".$from."\r\n";
    $headers .= "Reply-To: ".$from."\r\n";
    
    if (mail($to, $subject, $message, $headers)) {
    echo '<br>Mail accepted for delivery<br>';
    }
    else{
     echo '<br>There was an error. Mail not accepted for delivery<br>';
    }
    ?>
    
    Let's see what you get in this email so we can rule out Cpanel settings.
     
  16. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    ok just give me a few minutes and i will be back to let you know
     
  17. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    ok Zone69 that came back just perfect with the correct email address
     
  18. snowwhite

    snowwhite Power Member

    Joined:
    Feb 12, 2008
    Messages:
    730
    Likes Received:
    1,415
    Occupation:
    Psychiatrist
    Location:
    Las Islas Filipinas
    explanation is simple

    anything connected with DREAMHOST is either a Disaster or a Horror Story

    A colleague got his site busted for "blackhat stuff" as claimed by DREAMHOST. Problem is, the guy doesnt even know the meaning of spam. This happened just 2 days ago. Dreamhost should change its name to NIGHTMAREHOST
     
    • Thanks Thanks x 1
  19. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    yep i know there are lots of problems with them but at the moment this is driving me nuts , it does not make sense, all i want is the printable receipt sent back to the client with the correct return email address
     
  20. snowwhite

    snowwhite Power Member

    Joined:
    Feb 12, 2008
    Messages:
    730
    Likes Received:
    1,415
    Occupation:
    Psychiatrist
    Location:
    Las Islas Filipinas
    Now thats a contradiction, lol:p:p:p