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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:57:02+00:00 2026-06-12T10:57:02+00:00

This is my code that is working fine when I’m sending it to one

  • 0

This is my code that is working fine when I’m sending it to one recipient, i.e if I’m using 'rec1@gmail.com' (single email) it is working fine. However I want to include the second email id as well rec2@gmail.com and writing code like this: 'rec1@gmail.com,rec2@gmail.com' but this is not working.

Let me know how can I implement this functionality ?

$templateId = 1;
$sender = array(
    'name' => 'swapnesh',
    'email' => 'sender@gmail.com'
);
$store = Mage::app()->getStore();
$vars = array(
    'my_var' => 15,
    'another_var' => 12
);
$translate = Mage::getSingleton('core/translate');

// Send your email
Mage::getModel('core/email_template')->sendTransactional(
    $templateId,
    $sender,
    'rec1@gmail.com,rec2@gmail.com',
    'Recipient Name',
    $vars,
    $store->getId()
);
$translate->setTranslateInline(true);
  • 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-12T10:57:03+00:00Added an answer on June 12, 2026 at 10:57 am

    The answer is in Mage_Core_Model_Email_Template::send()

    You can see that $email and $names arguments can be both arrays. So in your case if will be:

    $recipients = [
        'rec1@gmail.com' => 'Recipient1 Name',
        'rec2@gmail.com' => 'Recipient2 Name'
    ];
    
    Mage::getModel('core/email_template')->sendTransactional(
        $templateId,
        $sender,
        array_keys($recipients),
        array_values($recipients),
        $vars,
        $store->getId()
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that is working fine for me: using System; using System.Collections.Generic;
I had this working in an old code that I didn’t end up using...
I've recently been working with code that looks like this: using namespace std; class
I have this simple code that is working fine in every browser, but NOT
I have this piece of code that is working fine in python 2.7. dist
Code that was working fine last week is suddenly throwing this exception: System.Data.SqlClient.SqlException (0x80131904):
Hi I have been working on this code that creates a table with radio
I have this code that I've edited: http://pastebin.com/vrqHek6S I've put in comments where I
I have this code that where I would normally use one line: if (tableView
I have the below code that was working fine until I tried adding the

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.