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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:58:35+00:00 2026-05-26T20:58:35+00:00

Libcurl uses the following to define the email recipient: #define RECIPIENT <bla@bla.com> But what

  • 0

Libcurl uses the following to define the email recipient:

#define RECIPIENT "<bla@bla.com>"

But what if I don’t want to hard code the recipient? I want a user to be able to supply his/her own email address, so I need to find a way to do this:

std::string emailreceiver = "bla@bla.com";
#define RECIPIENT = emailreceiver

The recipient is used in this line:

rcpt_list = curl_slist_append(rcpt_list, RECIPIENT);

I’m assuming I can’t simply change this to

std::string emailreceiver = "bla@bla.com";
rcpt_list = curl_slist_append(rcpt_list, emailreceiver);

Anyone have any suggestions?

  • 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-26T20:58:36+00:00Added an answer on May 26, 2026 at 8:58 pm

    Curl expects a C string (const char *), not a C++ string (std::string). So try:

    std::string emailreceiver = "bla@bla.com";
    rcpt_list = curl_slist_append(rcpt_list, emailreceiver.c_str());
    

    There’s no need to use a #define at all, that was just an example.

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

Sidebar

Related Questions

I'm compiling some code which uses libcurl on a Debian Linux system. My dev
I want to write an app which uses libcurl, I added the lib and
Our application uses libcurl for HTTP, and we want to get access to Internet
I'm developing dll that uses libcurl. After adding libcurl.dll and libidn-11.dll to dependences I
I'm developing a dll that uses libcurl. I builded lib with vc6curlsrc.dsw project (I
I get the following error when trying to ./configure libcurl 7.22.0 one or more
I have created an sample shared library, that uses libcurl. Here is the corresponding
I'm using LibCurl (with SSL) to retrieve XML from an API. But it gives
I'm trying to write a simple program which uses libcurl to perform HTTP POST
I have searched web for libCURL bindings for Go language, but failed to find

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.