Skip to content

Object reference error when attempting to deliver an email #25

@tigreye007

Description

@tigreye007

If you do not explicity specify the FROM address, you will receive an Object reference not set to an instance of an object. In a perfect world:

  1. If From address not set, attempt to set it from the web.config: MailAttributes.From = new MailAddress((WebConfigurationManager.OpenWebConfiguration("~/Web.config").GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup).Smtp.From);
  2. If still no from address set, throw a friendly argument exception "From Address must be set to a valid e-mail address"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions