<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Sending email via Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489364#M38270</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried one of the sample python code to send email to the active database user as part of the database maintenance procedure. But I have a problem in sending it because of the domain included in the username (e.g. xxx\username)...So, I want to remove the domain name and the backslash and retain only the username as the email list. (Please check the attached python code).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Nov 2016 10:15:31 GMT</pubDate>
    <dc:creator>ErnejunCorvera</dc:creator>
    <dc:date>2016-11-13T10:15:31Z</dc:date>
    <item>
      <title>Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489364#M38270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried one of the sample python code to send email to the active database user as part of the database maintenance procedure. But I have a problem in sending it because of the domain included in the username (e.g. xxx\username)...So, I want to remove the domain name and the backslash and retain only the username as the email list. (Please check the attached python code).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2016 10:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489364#M38270</guid>
      <dc:creator>ErnejunCorvera</dc:creator>
      <dc:date>2016-11-13T10:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489365#M38271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unzipping zips are a pain... so barring the pertinent code snippet... give this a look-see. Note in python the offending string is in 'raw' format, hence the 'r in front of it. &amp;nbsp;A backslash '\' is an escape designator, so to use one without raw format you have to put a double-backslash. &amp;nbsp;Then just split and if the username is the last, just grab the username from the end (-1), if it was the second last, you would use -2 etc&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"somedomain\xxx\username"&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; b
&lt;SPAN class="string token"&gt;'username'&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:31:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489365#M38271</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489366#M38272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the reply...yes that will work but how can I apply it inside the tuple?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/262842_Capture.JPG" style="width: 620px; height: 57px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2016 11:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489366#M38272</guid>
      <dc:creator>JunCorvera</dc:creator>
      <dc:date>2016-11-13T11:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489367#M38273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is user.Name returning the string in the format you showed&lt;/P&gt;&lt;P&gt;why don't you show what the actual emailList looks like minus the "@xxx.com.sa" stuff&lt;/P&gt;&lt;P&gt;because it can't be returning a simple string for user.Name&lt;/P&gt;&lt;P&gt;I suspect that it is returning one of the two incarnations that worked in the sample that follows. &amp;nbsp;&lt;/P&gt;&lt;P&gt;If it does, then you just need to modify the split&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain\\xxx\\username1"&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain/xxx/username1"&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain\xxx\username1"&lt;/SPAN&gt;
&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
SyntaxError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;unicode error&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'unicodeescape'&lt;/SPAN&gt; codec can't decode bytes &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; position &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; truncated \xXX escape
‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It can't just be returning a string with a single backslashes in it eitherwise it would throw and error at some point.&lt;/P&gt;&lt;P&gt;Notice that 'a' and 'b' are fine... either 'raw' format, double backslashes or a single forward slash will pass the test, not a single backslash&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"somedomain\\xxx\\username1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain\\xxx\\username2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain\\xxx\\username3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'username1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"somedomain/xxx/username1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain/xxx/username2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"somedomain/xxx/username3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'username1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489367#M38273</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489368#M38274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, when I ran the code userList = [user.Name for user in arcpy.ListUsers(workspace)], it returns a list of users with the format 123456\\xx.com.sa. when I ran your suggested code emails=[name.split("\\")[-1] for name in userList], it returns a list of username only but have a little problem there's a double quote at the end of the username....[u'123456"', u'6789"'].&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 04:56:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489368#M38274</guid>
      <dc:creator>JunCorvera</dc:creator>
      <dc:date>2016-11-14T04:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sending email via Python</title>
      <link>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489369#M38275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which is it?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;"username1\\xx.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;"username2\\xx.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;"username3\\xx.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'\\'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'xx.com'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'xx.com'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'xx.com'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'\\'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'username1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the username (my list 'a') looks like line 1 above, then you would have had to split using line 5 above to get the first part of the split.&lt;/P&gt;&lt;P&gt;once you have the parts as in line 7 above, you can concatenate what you want to it.. You will notice that they appear as email links...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; emails
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'username1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'username3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; new &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;e &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"@yy.com"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; e &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; emails&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; new
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;A class="jive-link-email-small" href="mailto:'username1@yy.com" rel="nofollow noopener noreferrer" target="_blank"&gt;'username1@yy.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;A class="jive-link-email-small" href="mailto:'username2@yy.com" rel="nofollow noopener noreferrer" target="_blank"&gt;'username2@yy.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;A class="jive-link-email-small" href="mailto:'username3@yy.com" rel="nofollow noopener noreferrer" target="_blank"&gt;'username3@yy.com&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/sending-email-via-python/m-p/489369#M38275</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:31:53Z</dc:date>
    </item>
  </channel>
</rss>

