Adding the 'from' element worked. I tried adding a 'cc' element and the email was sent but it did not send it to the 'cc' address. For now I will just include the 'cc' address within the 'from' element.<br>
<div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style><br>
<div class="gmail_quote">On Thu, Mar 31, 2011 at 8:27 AM, Earnie Boyd <span dir="ltr"><<a href="mailto:earnie@users.sourceforge.net">earnie@users.sourceforge.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">John Mitchell wrote:<br>
> Also I forgot to mention below that this is on drupal 6.<br>
><br>
> On Thu, Mar 31, 2011 at 6:44 AM, John Mitchell <<a href="mailto:mitchelljj98@gmail.com">mitchelljj98@gmail.com</a>>wrote:<br>
><br>
>> Within a custom module I am trying to send the below so that an email is<br>
>> sent but I get the error *The submitted from address () is not valid.*<br>
>> This *from *email address does exist so why is it giving me this error?<br>
>><br>
<br>
</div>You're missing the 'from' element in the message. But you shouldn't be<br>
using drupal_mail_send directly. You should use drupal_mail[1] and<br>
implement hook_mail[2] to add your subject and body to the message array.<br>
<br>
>> $message = array(<br>
'from' => '<a href="mailto:support@domain123.com">support@domain123.com</a>',<br>
<div class="im">>> 'to' => '<a href="mailto:username1@domain123.com">username1@domain123.com</a>',<br>
>> 'subject' => t('Example subject'),<br>
>> 'body' => t('Example body'),<br>
>> 'headers' => array('From' => '<a href="mailto:support@domain123.com">support@domain123.com</a>'),<br>
>> );<br>
>> drupal_mail_send($message);<br>
<br>
</div>[1]<br>
<a href="http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6" target="_blank">http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6</a><br>
[2]<br>
<a href="http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6" target="_blank">http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6</a><br>
<br>
--<br>
Earnie<br>
-- <a href="http://progw.com" target="_blank">http://progw.com</a><br>
-- <a href="http://www.for-my-kids.com" target="_blank">http://www.for-my-kids.com</a><br>
<font color="#888888">--<br>
</font><div><div></div><div class="h5">[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>John J. Mitchell<br>