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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:18:45+00:00 2026-06-17T05:18:45+00:00

I have this code: require net/smtp MAIL_SERVER = xxx.ad.xxx.net def lib_sending_report(email_hash) # define message

  • 0

I have this code:

require "net/smtp"

MAIL_SERVER = "xxx.ad.xxx.net"

def lib_sending_report(email_hash)

    # define message body

    message = <<"MESSAGE_END"

From: <#{email_hash[:sender]}>

To: <#{email_hash[:recipients]}>

MIME-Version: 1.0

Content-type: text/html

Subject: #{email_hash[:subject]}

<p>Hi All,</p>

    <p>We've just executed a round of load test.</p>

<p>Regards</p>
MESSAGE_END

    Net::SMTP.start(MAIL_SERVER) do |smtp|
      smtp.send_message message, email_hash[:sender], email_hash[:recipients]
    end
end

test = ""
lib_sending_report( {:sender => "abc@xxx.com",
                      :recipients => "abc@xxxx.com",
                      :subject => "Load.Test.Report.of.#{test}"} )

When I change :recipients => "abc@xxxx.com" to :recipients => "abc@xxxx.com;efg@xxx.com", it gives me this error:

 501 5.5.4 Invalid Address (Net::SMTPSyntaxError)

I can successfully send email when :recipients => "abc@xxxx.com" just have one recipient.

Where am I wrong? It seems that the separator(semicolon) I used is wrong.

I tried to use comma instead of semicolon, but it didn’t work

  • 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-17T05:18:47+00:00Added an answer on June 17, 2026 at 5:18 am

    Net::SMTP’s send_message takes an array of “To:” address strings.

    Per the documentation:

    to_addr is a String or Strings or Array of Strings, representing the destination mail address or addresses.

    This example from the documentation shows how:

    Net::SMTP.start('smtp.example.com') do |smtp|
      smtp.send_message msgstr,
                        'from@example.com',
                        ['dest@example.com', 'dest2@example.com']
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: require 'net/smtp' #This method prints the method starttls p
i have seen this code : var myNet = require (net); and in some
I have this code require 'mechanize' @agent = Mechanize.new page = @agent.get('http://something.com/?page=1') next_page =
I have this code: ie1.link(:text, /Exception:/) It is producing an error message which I
I have this code: def __init__(self, a, b, c, d...): self.a = a self.b
I have this code to check if the site is up or down: require
I have the following code: require 'rubygems' require 'net/http' require 'uri' url = URI.parse('http://servername.tld/up.txt')
I have the following Ruby code: require 'net/http' require 'uri' include Net $DEBUG =
i have the following code: var net = require('net'); var server = net.createServer(function (stream)
So, I have this code in a controller: before_filter :require_login, :only => :new, :edit,

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.