I'm really new to coding so please know I'll use wrong terms and try to learn whenever corrected.
My problem has something to do with an F macro line. It's a code to send emails through smtp server and has this line:
client.println(F("To: JohnSmith@gmail.com"));
But I want to change the code so that is uses a char[] variable. In this code, I want to use the char[] blynk_token. I was thinking this:
client.println(F("To: blynk_token"), blynk_token[32]);
But I get errors compiling like this:
What am I doing wrong? Thanks for looking.
C:\Users\JohnSmith\Documents\Arduino\ExampleCode1\ExampleCode1.ino: In function 'byte sendEmail2()':
ExampleCode1:262: error: call of overloaded 'println(const __FlashStringHelper*, int)' is ambiguous
client.println(F("RCPT To: blynk_token"), (int)blynk_token[32]);
^
C:\Users\JohnSmith\Documents\Arduino\ExampleCode1\ExampleCode1.ino:262:65: note: candidates are:
In file included from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Stream.h:26:0,
from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/HardwareSerial.h:31,
from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:245,
from sketch\ExampleCode1.ino.cpp:1:
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:83:16: note: size_t Print::println(unsigned char, int)
size_t println(unsigned char, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:83:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'unsigned char'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:84:16: note: size_t Print::println(int, int)
size_t println(int, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:84:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:85:16: note: size_t Print::println(unsigned int, int)
size_t println(unsigned int, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:85:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'unsigned int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:86:16: note: size_t Print::println(long int, int)
size_t println(long, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:86:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'long int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:87:16: note: size_t Print::println(long unsigned int, int)
size_t println(unsigned long, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:87:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'long unsigned int'
ExampleCode1:269: error: call of overloaded 'println(const __FlashStringHelper*, int)' is ambiguous
client.println(F("To: blynk_token"), (int)blynk_token[32]);
^
C:\Users\JohnSmith\Documents\Arduino\wireless_gunsafe_4_parameterCHANGE_email1\wireless_gunsafe_4_parameterCHANGE_email1.ino:269:61: note: candidates are:
In file included from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Stream.h:26:0,
from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/HardwareSerial.h:31,
from C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:245,
from sketch\wireless_gunsafe_4_parameterCHANGE_email1.ino.cpp:1:
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:83:16: note: size_t Print::println(unsigned char, int)
size_t println(unsigned char, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:83:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'unsigned char'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:84:16: note: size_t Print::println(int, int)
size_t println(int, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:84:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:85:16: note: size_t Print::println(unsigned int, int)
size_t println(unsigned int, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:85:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'unsigned int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:86:16: note: size_t Print::println(long int, int)
size_t println(long, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:86:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'long int'
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:87:16: note: size_t Print::println(long unsigned int, int)
size_t println(unsigned long, int = DEC);
^
C:\Users\JohnSmith\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Print.h:87:16: note: no known conversion for argument 1 from 'const __FlashStringHelper*' to 'long unsigned int'
exit status 1
call of overloaded 'println(const __FlashStringHelper*, int)' is ambiguous