[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 658
  • Last Modified:

email with attachment example issues

I am workling on following example


I am wondering If i need to do any set up to run this exampe.

what are the values i need to give for host from to etc fields.

Do i need to specify relative or absolute path for the attachment.

Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
2 Solutions
Amitkumar PSr. ConsultantCommented:
Host will be the SMTP Server (that is used to send the mails)
From will be the email id of Sender
To will be the email id of Receiver

Please refer the below link that uses the SMTP server of gmail.


Alongwith the above, you will have to use the username/password of your email account.
Pramod KumarCommented:
The sample code you are referring is built with default values like:

1. The smtp server may or may not require authentication before sending.
2. The smtp server's default port is 25 but can be different server to server.

You should be sure about these default values as per your SMTP server.

I have posted my sample for you in your another same query thread:

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now