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 8600675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:40:12+00:00 2026-06-12T01:40:12+00:00

I’m trying to do the following using the latest SendGrid php information found here.

  • 0

I’m trying to do the following using the latest SendGrid php information found here.
For a real estate portal, let’s say a few people (5) are interested in an open house in Florida, represented by a real estate agent. An array includes their emails like this $prospect_email_array[], names like this $prospect_name[], realtor like this $realtor, and location like this $location. What would be the appropriate way to send an email out to them, in one go, as blind copies (so no prospect sees other prospects email addresses), efficiently. I am looking for comprehensive code to accomplish this. So far, on the php side, I have this pseudo code:

   To: $prospect_email_array[]
 From: mail@realestatesite.com
Title: $realtor's Open House in $location Welcome
 Body: 
       Dear $prospect_name[],

       I hope to see you in our upcoming open house in $location.

       Looking forward to seeing you there!

       Best Wishes,
       $realtor

In addition, having a plain text version and html version is what I’m after. Will the equivilant of 2 ‘br’ tags be preserved in plain text? Are 2 ‘br’ tags needed in the html version for spacing as above? There may be emails for open houses, house interest, and potential buyers. Would these be the categories to use in SendGrid? Also, is utf-8 supprorted by default, or do we need to pass something to SendGrid?

  • 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-06-12T01:40:13+00:00Added an answer on June 12, 2026 at 1:40 am

    Here’s some “pseudo code” that should accomplish most of what you’re trying to do. I haven’t tested this at all and it’s quite possible that there are typos and irregularities in it. It should get you moving in the right direction though.

    <?php
    
    include 'path/to/sendgrid-php/SendGrid_loader.php';
    
    $sendgrid = new SendGrid('username', 'password');
    
    $mail = new SendGrid\Mail();
    $mail->setFrom('mail@realestatesite.com')->
           setSubject($realtor . "'s Open House in " . $location)->
           setText('[Fill this in yourself as an exercise]')->
           setHtml('Dear %name%,<br />I hope to see you in our upcoming open house in ' . $location . '. <br /> Looking forward to seeing you there! <br /> Best Wishes, <br />' . $realtor);  
    
    $mail->setRecipientsInHeader(true);
    
    foreach ($prospect_email_array as $prospect) {
      $mail->addTo($prospect);
    }
    
    $mail->addSubstitution("%name%", $prospect_name);
    $sendgrid->smtp->send($mail);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

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.