943,936 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 976
  • ASP.NET RSS
Jan 11th, 2008
0

Sending mails......

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nice_true is offline Offline
28 posts
since Sep 2007
Jan 11th, 2008
0

Re: Sending mails......

set smtpClient.host property

write the name of server in smtpClient.host
Reputation Points: 10
Solved Threads: 1
Newbie Poster
priyankaagrawal is offline Offline
21 posts
since Feb 2007
Jan 11th, 2008
0

Re: Sending mails......

Hello to you
I'll just give you a sumary of what I did in a very similar scenario.

ASP.NET Syntax (Toggle Plain Text)
  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.
Click to Expand / Collapse  Quote originally posted by nice_true ...
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
Reputation Points: 215
Solved Threads: 6
Posting Whiz in Training
jamello is offline Offline
219 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Create Setup
Next Thread in ASP.NET Forum Timeline: gridview





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC