Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7193215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:07:28+00:00 2026-05-28T20:07:28+00:00

Before I was using a mail function in PHP on my contact form. However

  • 0

Before I was using a mail function in PHP on my contact form.

However my hosting company is now blacklisted which is a real pain.

So now the goal is to use SMTP.

The code below works but kick everything to spam.

Please do not give me a negative for asking a question. I have checked on Google and read other sources. I am looking for help.

//STARTING HERE
require_once 'lib/swift_required.php';

$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
  ->setUsername('example@gmail.com')
  ->setPassword('example')
  ;

$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);

$message = Swift_Message::newInstance('Wonderful Subject')
  ->setFrom(array('contact@example.example' => 'Contact form'))
  ->setTo(array('123@gmail.com', '123@123.com' => 'Author leon')) 
  ->setBody('Here is the message itself')
  ;


$result = $mailer->send($message);
if ($result)
echo "Success " . $result; // if 1 one email has been sent, if 2 then two emails hes been sent.
else
echo "Error";
?>

EMAIL HEADER

Delivered-To: example@example.com
Received: by 10.204.231.11 with SMTP id jo11cs300466bkb;
        Wed, 1 Feb 2012 08:11:30 -0800 (PST)
Received: by 10.180.77.228 with SMTP id v4mr19801267wiw.2.1328112690201;
        Wed, 01 Feb 2012 08:11:30 -0800 (PST)
Return-Path: <contact@example.example.tv>
Received: from rweb2-v.000025.net (rweb2-v.000025.net. [89.238.128.229])
        by mx.google.com with ESMTPS id u2si18187663weq.118.2012.02.01.08.11.29
        (version=TLSv1/SSLv3 cipher=OTHER);
        Wed, 01 Feb 2012 08:11:29 -0800 (PST)
Received-SPF: neutral (google.com: 89.238.128.229 is neither permitted nor denied by best guess record for domain of contact@example.example.tv) client-ip=89.238.128.229;
Authentication-Results: mx.google.com; spf=neutral (google.com: 89.238.128.229 is neither permitted nor denied by best guess record for domain of example@example.tv) smtp.mail= example@example.tv
Received: from pib by rweb2-v.000025.net with local (Exim 4.69)
    (envelope-from <example@example.tv>)
    id 1RscmP-000iR1-1g; Wed, 01 Feb 2012 16:11:29 +0000
To: example@example, Author leon <example@example.com>
Subject: Wonderful Subject
Message-ID: <1328112689.4f296431088d2@example.tv>
Date: Wed, 01 Feb 2012 16:11:29 +0000
From: Contact form < example@example.tv>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - rweb2-v.000025.net
X-AntiAbuse: Original Domain - example.com
X-AntiAbuse: Originator/Caller UID/GID - [1144 1145] / [47 12]
X-AntiAbuse: Sender Address Domain – example@example.tv

Here is the message itself
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:07:28+00:00Added an answer on May 28, 2026 at 8:07 pm

    The solution what found, after removing a // of these from the code it worked.

    So the question is can you have HTML inside you email?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

before few days i have been comfortably sending emails using PHP mail function. but
I'm using jQuery's AJAX function to send a message from a contact form -
I am using Microsoft CRM4 Mail merge function, which stores Word files as XML
I have a problem when sending a form via email using the PHP Mail
I'm using PHP's mail() function to send SMS messages. It works fine, except that
I'm working on better understanding Linq-to-SQL before using on a real project, so I'm
When using the add Account... function in the 'Mail,Contacts, Calendars' section in 'Settings' on
I normally use this function to sanitize my form inputs before storing them into
In my PHP program, I am having trouble with the mail() function. I can
I'm using PHP for sending an e-mail. The values in the e-mail are depending

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.