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

  • Home
  • SEARCH
  • 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 8024261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:48:56+00:00 2026-06-04T22:48:56+00:00

I am trying to setup a mailer with SMTP and getting the following error

  • 0

I am trying to setup a mailer with SMTP and getting the following error (from console):

SyntaxError (/Users/nelsonkeating/Desktop/prelaunch/app/mailers/user_mailer.rb:6: invalid multibyte char (US-ASCII)
/Users/nelsonkeating/Desktop/prelaunch/app/mailers/user_mailer.rb:6: syntax error, unexpected $end, expecting ']'
    headers[‘X-MC-Track’] = "opens, clicks"
             ^):
  app/models/user.rb:37:in `send_welcome_email'

user_mailer.rb:

class UserMailer < ActionMailer::Base
  default :from => "remindeal@gmail.com"

  def welcome_email(user)
    mail(:to => user.email, :subject => "Invitation Request Received")
    headers[‘X-MC-Track’] = "opens, clicks"
    headers[‘X-MC-GoogleAnalytics’] = "example.com"
    headers[‘X-MC-Tags’] = "welcome"
  end
end

User.rb:

35 def send_welcome_email
36    unless self.email.include?('@example.com')
37      UserMailer.welcome_email(self).deliver
    end
  end
  • 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-04T22:48:58+00:00Added an answer on June 4, 2026 at 10:48 pm

    Ruby only accepts single quote, double quote and backquote to quote strings. Each of them has different meaning.

    Since you’re quoting keys of headers hash with multibyte forward quote and backquote, ruby emit the error. I guess you copy pasted some of prettified source codes on some web site.

    You can replace above source like this, using single quotes:

    headers['X-MC-Track'] = "opens, clicks"
    headers['X-MC-GoogleAnalytics'] = "example.com"
    headers['X-MC-Tags'] = "welcome"
    

    Note that, typically, using symbols (:like_this) for a hash key is recommended, but for the case like above, you need to use either single quote or double quotes, since it contains - as the part of the keys.

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

Sidebar

Related Questions

Trying to setup a rails app and getting following error. Any ideas? b/tasks instead.
I'm trying to setup a simple mailer in rails 3.1. I have the following
Trying to setup replication from gerrit to my github repo. Getting this stacktrace: [2011-09-20
Trying to setup Mandril SMTP in my rails app.. when i go to register
Im trying to setup my asp.net mvc page like the following image: The header
When trying to setup a lock (pessimistic), with the following code: em.lock(controlnumbers, LockModeType.WRITE); em.refresh(controlnumbers);
Been trying to setup my Facebook app which I want to use for Logins
I'm trying to setup a django app that allows me to store and lookup
I'm getting error in ActionMailer when my worker is trying to send email Errno::ECONNREFUSED
Im trying to setup situation where users of application can do statistical analysis of

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.