Hello, I'm new at programming with VB .net. When i tried to make an emailer plus file attacher i am getting errors at this line If i am making with path textbox and if i dont write textbox name in "attachedFile" slot i get error cause it's not defined, BUT if i write correct name i get an error at It says "Variable 'attach' is used before it has been assigned value. A null reference could result exception at a runtime." any help? Thank you in advance
Code:
If My.Computer.FileSystem.FileExists(attachedFile) Then message.Attachments.Add(attach)
Code:
message.Attachments.Add(attach)