Sending mails......

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 28
Reputation: nice_true is an unknown quantity at this point 
Solved Threads: 0
nice_true nice_true is offline Offline
Light Poster

Sending mails......

 
0
  #1
Jan 11th, 2008
Hello!

I had problem sending mails through asp.net, even after writing the code.
But after providing the IP address of my pc in the relay option in IIS, the problem finally got solved.


But now the problem is that the same code when I tried to run on a pc which was a local server, I still face the problem.

I write the follwing code
dim mm as new mailmessage
mm.to="rasvinder.soodan@gmail.com"
mm.from="rasvinder.soodan@gmail.com"
mm.subject="hello"
mm.body="hello"
mm.priority=priority.high
smtpmail.smtpserver="theip addrss of the local machine"
smtpmail.send(mm)


The above code runs succesfully on one pc, which is a normal client pc, but when run on a server machine, mail are not sent.

Can u plz help me out?


Thanks
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 21
Reputation: priyankaagrawal is an unknown quantity at this point 
Solved Threads: 1
priyankaagrawal priyankaagrawal is offline Offline
Newbie Poster

Re: Sending mails......

 
0
  #2
Jan 11th, 2008
set smtpClient.host property

write the name of server in smtpClient.host
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 216
Reputation: jamello is an unknown quantity at this point 
Solved Threads: 6
jamello's Avatar
jamello jamello is offline Offline
Posting Whiz in Training

Re: Sending mails......

 
0
  #3
Jan 11th, 2008
Hello to you
I'll just give you a sumary of what I did in a very similar scenario.

  1.  
  2. Dim oMsg As New CDO.Message
  3. Dim iConfig As CDO.IConfiguration
  4. Dim oFields As ADODB.Fields
  5. Dim oField As ADODB.Field
  6.  
  7.  
  8. Dim strEmailAddress As String = "jobstar@yahoo.co.uk"
  9. Dim strSubject As String = "Request for missions"
  10. Dim msgMail As String = "Pls Find below the details. Thank You."
  11.  
  12. iConfig = oMsg.Configuration
  13. oFields = iConfig.Fields
  14. ' Set configuration.
  15. 'using the local smtp server
  16. oField = oFields("http://schemas.microsoft.com/cdo/configuration/sendusing")
  17. oField.Value = 1
  18. oFields.Update()
  19.  
  20. Try
  21.  
  22. 'message()
  23. oMsg.TextBody = msgMail
  24. oMsg.Subject = strSubject
  25.  
  26. oMsg.From = "terrastar@comstar.net"
  27. oMsg.To = strEmailAddress
  28. oMsg.Send()
  29.  
  30. Catch x As Exception
  31. Finally
  32.  
  33. End Try
  34.  
Then on the server uncheck the 'allow all computers which successfully authenticate to relay regardless of the list above'

This should work. It worked for me. If any problems please get back to me.
Originally Posted by nice_true View Post
Hello!

I had problem sending mails through asp.net, even after writing the code.
But after providing the IP address of my pc in the relay option in IIS, the problem finally got solved.


But now the problem is that the same code when I tried to run on a pc which was a local server, I still face the problem.

I write the follwing code
dim mm as new mailmessage
mm.to="rasvinder.soodan@gmail.com"
mm.from="rasvinder.soodan@gmail.com"
mm.subject="hello"
mm.body="hello"
mm.priority=priority.high
smtpmail.smtpserver="theip addrss of the local machine"
smtpmail.send(mm)


The above code runs succesfully on one pc, which is a normal client pc, but when run on a server machine, mail are not sent.

Can u plz help me out?


Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC