I am saving emails from outlook to the local folder.Folder path is following.
folder_path=r"C:\Documents\emails
filename is the subject of the email message as the following
subject=email_message.subject
so the final_path will be
final_path=os.path.join(folder_path,subject+".eml")
sometimes the subject contains "/" and then it gives the following error
[Error2] No such file or directory: 'C:\\Documents\\emails\\test1/email_123'
I think this is because that extra "/" in the subject line (subject was "test1/email_123")
How can I fix this?