Hi Ken,
Found the culprit! It was the SMTP settings. Here's what I did.
I looked for email timeouts which caused 504 errors. And came across this post (https://moodle.org/mod/forum/discuss.php?d=360614) which had exactly the same problem I descibed.
I removed the perfectly correct SMTP settings (because these same settings work for other email clients) from the Moodle smtp configuration form. Then tested the Assignment Submission and it worked like a charm.
I also installed this plugin "Moodle eMailTest" https://moodle.org/plugins/local_mailtest
And now i realized its not the suphp or suexec. But I still dont know why my smtp settings didnt work here.
Hope this solution helps everyone who are searching for similar issue.
Thanks Ken for all your time and support.
Found the culprit! It was the SMTP settings. Here's what I did.
I looked for email timeouts which caused 504 errors. And came across this post (https://moodle.org/mod/forum/discuss.php?d=360614) which had exactly the same problem I descibed.
I removed the perfectly correct SMTP settings (because these same settings work for other email clients) from the Moodle smtp configuration form. Then tested the Assignment Submission and it worked like a charm.
I also installed this plugin "Moodle eMailTest" https://moodle.org/plugins/local_mailtest
And now i realized its not the suphp or suexec. But I still dont know why my smtp settings didnt work here.
Hope this solution helps everyone who are searching for similar issue.
Thanks Ken for all your time and support.