locked
'From' email address unresolved RRS feed

  • Question

  • I am using the following in an iframe application to email a queue:

    // Create activity party for the email (from)
    activityparty FromParty = new activityparty();
    FromParty.partyid = new Lookup();
    FromParty.partyid.type = EntityName.systemuser.ToString();

    //The 'from' of this email will be the current user
    FromParty.partyid.Value = GetCurrentUser.GetUser().UserId;  //Custom method, uses WhoAmIRequest()

    // Create activity party for the email(to)
    activityparty ToParty = new activityparty();
    ToParty.partyid = new Lookup();
    ToParty.partyid.type = EntityName.queue.ToString();
    Guid IdTo = new Guid("4D2BE426-34CD-DD11-871A-001E0BBED63A"); // ID of a CRM queue
    ToParty.partyid.Value = IdTo;

    // Create an email message.
    email email = new email();

    // Set email properties
    email.to = new activityparty[] { ToParty };
    email.from = new activityparty[] { FromParty };
    email.description = Body;
    email.subject = Subject;

    if (Account != null)
    {
     email.regardingobjectid = new Lookup();
     email.regardingobjectid.type = EntityName.account.ToString();
     email.regardingobjectid.Value = Account.accountid.Value;
    }

    CrmBoolean direction = new CrmBoolean();
    direction.Value = true;
    email.directioncode = direction;
    TargetCreateEmail targetCreate = new TargetCreateEmail();
    targetCreate.Email = email;
    CreateRequest request = new CreateRequest();
    request.Target = targetCreate;
    CrmService service = GetCrmService.GetService();
    CreateResponse response = (CreateResponse)service.Execute(request);
    Guid emailID = response.id;


    SendEmailRequest req = new SendEmailRequest();
    req.EmailId = emailID;
    req.TrackingToken = " ";
    req.IssueSend = true;

    SendEmailResponse res = (SendEmailResponse)service.Execute(req);

    I get an email in the queue, but the 'From' email address is unresolved, even though they are users in the system.
    Is there any way around this??

    Thanks
    Ken

    Thursday, April 16, 2009 3:59 PM

Answers

  • Hi Ken,

    Check out if the primary e-mail for the user that you have specified in the from part of email is proper.
    Or check out this hotfix that was for CRM 3.0, may it could apply in your case

    http://support.microsoft.com/default.aspx/kb/915413

    Regards,
    Nishant Rana

    http://nishantrana.wordpress.com
    • Marked as answer by Ken Bagwell Friday, April 17, 2009 1:59 PM
    Thursday, April 16, 2009 4:19 PM