php mailer (missing brackets?)

Posted on 2012-12-27
Last Modified: 2013-01-01
This is setting up a swift mail script, I'm getting this error.
Parse error: syntax error, unexpected $end in mailer.php on line 176 (last line).

Looks like I'm supposed to be missing a bracket, but I can't find it...I need some different eyes on this.

Question by:ststesting
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 13

Expert Comment

ID: 38724593

The Header directive is an HTML directive not PHP.  It belongs outside the closing PHP tag.  Try the code below.

$result = $mailer->send($message);

header("Location: HTTP://domain/thank-you.html")

Best regards,


Author Comment

ID: 38724652
Thanks for the help, I moved that below, or just deleted it for now. My last line of code ($result...) is still highlighted like it didn't fix the problem.

Accepted Solution

ststesting earned 0 total points
ID: 38724695
Looks like there were two things, I missed a ; on line 121 $to =

And the EOD; cannot be indented.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 14

Expert Comment

by:Scott Madeira
ID: 38724700
In your code the EOD; on lines 95, 102, etc. must be in the first column.  It cannot be indented.
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38724751
Not true, that header is a PHP function.  It is correct in your posted code.

I'm not sure what is causing the error you're getting but all of your 'if' and 'elseif' statements are wrong because a single '=' is an assignment, not a comparison.  Should be:

if ($hiddest == 'contact')

Open in new window


Author Closing Comment

ID: 38734235
figured out what I was missing

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
A responsive image gallery using flexbox 6 78
P3P validator , ASP, PHP ,Https and Http links 3 43
Securing source code... theoretical question 10 48
PHP processing webform 25 45
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question