Try using a different variable name on the left side for attachment, because Attachment is part of the namespace System.Net.Mail, which you are using on the right side.
Looks like OP has both Microsoft.Exchange.WebServices.Data & System.Net.Mail namespaces imported in his project there by causing the conflict with attachment.
Try using fully qualified namespace:
attachment = new System.Net.Mail.Attachment(item,System.Net.Mime.MediaTypeNames.Application.Octet)