Set up variable in const char?

I'm currently following this example and trying to experiment with the code to see if I can get it to perform the functions I want:

https://github.com/curl/curl/blob/master/docs/examples/smtp-tls.c

Here's my current edit to the message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const char *user = {
	"John Doe"
};

const char *reason = {
	" this is a test."
};

static const char *payload_text[] = {
  "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
  "To: " TO "\r\n",
  "From: " FROM " (Example User)\r\n",
  "Cc: " CC " (Another example User)\r\n",
  "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@"
  "rfcpedant.example.org>\r\n",
  "Subject: SMTP TLS example message\r\n",
  "\r\n", /* empty line to divide headers from body, see RFC5322 */
  "Hi, ", user, " you have received this message because " , reason "\r\n",
  NULL
};


When used, I get a message that says "Hello John Doe, you have received this message because this is a test." Now, I want to be able to set this up in C++ so the user and program can create different messages. i.e.

"What is your name?"
Bill E. Bob
-Code does stuff-
-Code determines what the message should be about-

user = Bill E. Bob

reason = variable based on what the user did in the program

How would I go about doing this? I can't just use a typical cin string for this.
You don't even bother to respond when I try to answer your questions.
Did the certificate thing work???
Oh sorry about that. I misunderstood the concept and the certificate it was looking for wasn't for gmail it was actually looking for a certificate from me. ^^; I did manage to sort that out though.
Topic archived. No new replies allowed.