I'm wanting to add CC recipients to the email code below. Anyone have an idea on how I can alter this code?
<SPAN class="comment token"># Import smtplib for the actual sending function</SPAN>
<SPAN class="keyword token">import</SPAN> smtplib
<SPAN class="comment token"># For guessing MIME type</SPAN>
<SPAN class="keyword token">import</SPAN> mimetypes
<SPAN class="comment token"># Import the email modules we'll need</SPAN>
<SPAN class="keyword token">import</SPAN> email
<SPAN class="keyword token">import</SPAN> email<SPAN class="punctuation token">.</SPAN>mime<SPAN class="punctuation token">.</SPAN>application
SERVER <SPAN class="operator token">=</SPAN> <SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-email-small" href="mailto:dhsrhshseh@test.com" rel="nofollow noopener noreferrer" target="_blank">dhsrhshseh@test.com</A><SPAN>"</SPAN></SPAN>
<SPAN class="comment token"># Create a text/plain message</SPAN>
msg <SPAN class="operator token">=</SPAN> email<SPAN class="punctuation token">.</SPAN>mime<SPAN class="punctuation token">.</SPAN>Multipart<SPAN class="punctuation token">.</SPAN>MIMEMultipart<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'Subject'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Test Subject'</SPAN>
msg<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'From'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-email-small" href="mailto:MyEmail@test.com" rel="nofollow noopener noreferrer" target="_blank">MyEmail@test.com</A><SPAN>"</SPAN></SPAN>
msg<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'To'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-email-small" href="mailto:ToEmail@test.com" rel="nofollow noopener noreferrer" target="_blank">ToEmail@test.com</A><SPAN>"</SPAN></SPAN>
<SPAN class="comment token"># The main body is just another attachment</SPAN>
body <SPAN class="operator token">=</SPAN> email<SPAN class="punctuation token">.</SPAN>mime<SPAN class="punctuation token">.</SPAN>Text<SPAN class="punctuation token">.</SPAN>MIMEText<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"""This is a test"""</SPAN><SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">.</SPAN>attach<SPAN class="punctuation token">(</SPAN>body<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># PDF attachment</SPAN>
filename<SPAN class="operator token">=</SPAN><SPAN class="string token">"Test.pdf"</SPAN>
fp<SPAN class="operator token">=</SPAN>open<SPAN class="punctuation token">(</SPAN>filename<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'rb'</SPAN><SPAN class="punctuation token">)</SPAN>
att <SPAN class="operator token">=</SPAN> email<SPAN class="punctuation token">.</SPAN>mime<SPAN class="punctuation token">.</SPAN>application<SPAN class="punctuation token">.</SPAN>MIMEApplication<SPAN class="punctuation token">(</SPAN>fp<SPAN class="punctuation token">.</SPAN>read<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>_subtype<SPAN class="operator token">=</SPAN><SPAN class="string token">"pdf"</SPAN><SPAN class="punctuation token">)</SPAN>
fp<SPAN class="punctuation token">.</SPAN>close<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
att<SPAN class="punctuation token">.</SPAN>add_header<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Content-Disposition'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'attachment'</SPAN><SPAN class="punctuation token">,</SPAN>filename<SPAN class="operator token">=</SPAN>filename<SPAN class="punctuation token">)</SPAN>
msg<SPAN class="punctuation token">.</SPAN>attach<SPAN class="punctuation token">(</SPAN>att<SPAN class="punctuation token">)</SPAN>
server <SPAN class="operator token">=</SPAN> smtplib<SPAN class="punctuation token">.</SPAN>SMTP<SPAN class="punctuation token">(</SPAN>SERVER<SPAN class="punctuation token">)</SPAN>
server<SPAN class="punctuation token">.</SPAN>sendmail<SPAN class="punctuation token">(</SPAN><SPAN class="string token"><A class="jive-link-email-small" href="mailto:'MyEmail@test.com" rel="nofollow noopener noreferrer" target="_blank">'MyEmail@test.com</A><SPAN>'</SPAN></SPAN><SPAN class="punctuation token">,</SPAN> msg<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'To'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> msg<SPAN class="punctuation token">.</SPAN>as_string<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
server<SPAN class="punctuation token">.</SPAN>quit<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Email sent."</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>