Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using this code.
C#
Dim mail As New MailMessage()
mail.[To].Add("pabc@gmail.com")
mail.From = New MailAddress("abc@gmail.com")
mail.Subject = "Email using Gmail"
mail.Body = ""


mail.IsBodyHtml = True
Dim smtp As New SmtpClient()
smtp.Host = "smtp.gmail.com"
smtp.EnableSsl = True
smtp.Port = 587
smtp.Credentials = New System.Net.NetworkCredential(  mail.From,password)
smtp.Send(mail)


but i want to sent mail without checking password or remot server ip.
Posted
Updated 30-Jul-15 21:36pm
v2
Comments
stibee 31-Jul-15 3:35am    
Welcome to "spam- world" in the case you can send mails from gmail without any authentication.

You probably can't - most servers require authorisation to prevent people form sending message as if it had originated with the company.
The only reason I can see for wanting to do this is to generate spam or phishing emails, which is malicious activity.

We do not condone, support or assist in the production of malicious code in any way, form or manner. This is a professional site for professional developers.

If you want to know how to create such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
 
Share this answer
 
You can't send through gmail without a username and password, but you shouldn't be sending through gmail anyway. If your site is on a web host use the smtp server provided by the host (the details will be in your control panel). If your site is on a local network then ask the network admin for details of what smtp server you can use.

https://forums.asp.net/post/5825785.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900