I have been trying to put the following line into a spool file:
execute send_mail('[email protected]','[email protected]','TEST SUBJECT','PROD:USERS is 75% used');

by the following sql:
dbms_output.put_line('execute send_mail('''||send_address||''','''||rec_address||''','''TSA Alert''','''||dbname||''': '''||tbsname||''' is '''||bytes_pct||'''% used''');');

(where :
send_address := '[email protected]'
rec_address := '[email protected]'
dbname := 'PROD'
tbsname := 'USERS'
bytes_pct := '75')

But I get the following error:
ORA-01756: quoted string not properly terminated

I have now been working on this all day, by adding or removing the single quotes, even using chr(39), but still can't seem to crack this. Can anyone please help?