Click here to Skip to main content
15,908,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi !!!
I have a problem with SMTP server.
I have a SMTP server, when i send mail, it will auto get gmail account to send.
I dont know what happens. I think because of setting of SMTP.
How can it debbug it ??? I have debug in code :
smtpclient.send(mailmessage) From email is correct but when i check in mail box it is not right.

Please help me !!!
Posted
Comments
[no name] 12-May-14 15:02pm    
Help you with what? If you have your own SMTP mail server, what does gmail have to do with anything?
baotdinh 12-May-14 16:39pm    
I have configured email A in SMTP, i have a email B which is configured in my application, when email in application is null , it will use email in SMTP. But now it always use email A in SMTP.
Is it correct ???

1 solution

Hi,

this is the only code you use?

The SMTP client objects uses the server settings by default.
I think there is the Gmail-Account set in the server or application settings.

Try the following code:
VB
Dim SmtpObj As New System.Net.Mail.SmtpClien
SmtpObj.Host = "smtp.mailserver.com"
SmtpObj.Credentials = New System.Net.NetworkCredential("user", "password")
SmtpObj.EnableSsl = True
SmtpObj.Port = 587
SmtpObj.Send(mail)

Regards,
Andi
 
Share this answer
 
v2

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