Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0SendMail Method in DNNSendMail Method in DNN
Previous
 
Next
New Post
5/17/2008 7:15 PM
 

The sender is always the same in all my examples.  In some it works and in others it doesn't work depending on the email address in the TO field.

I'll just switch up to a non-DNN send function and see how that works.


I'm too poor for anything other than the community version
 
New Post
5/17/2008 7:29 PM
 

please let us know your results, thanks!


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
5/17/2008 7:34 PM
 

FYI: .net simply passes the mail to an smtp server. Some smtp servers reject messages that don't have a to & from & subject & body, some may reject messages that are not sent from the actual from domain (relay), some perform a dns check on the sender's email address, and some may perform blacklist checks as well.

In addition, the receiving server my reject the message if the email account is invalid, the originating domain is blacklisted, or even if the mailbox is full.

Have you tested sending and receiving to this particular address using the same smtp server with a standard email client?

Just a thought...

 


Dwayne J. Baldwin
 
New Post
5/17/2008 8:37 PM
 

Thanks.  Yeah I know the email address is good because it's my personal email address at AOL and it receieves other emails from the same mysite.com account sent from my DNN portal.  I know the only variable that changes between a successful send and a failed one is the TO email address.  Even a difference of sending to X@mysite.com (which works) and B@mysite.com (which fails).  Here is my code...maybe there is something in it that didn't survive the translation from DNN3 to 4:

Private Sub DenyUser(ByVal UserID As Integer)
   Dim OurUserID As Integer
   OurUserID = UserID
   Dim RequestController As New Ryno.DNN.Modules.Access.Business.AccessController
   Dim RequestInfo As New  Ryno.DNN.Modules.Access.Business.AccessInfo
   RequestInfo = RequestController.GetAccess(OurUserID)
   RequestInfo.Approved = False
   RequestInfo.GADeny = True
   RequestController.UpdateAccess(RequestInfo)

' Now send out the email
  Dim OurUserInfo As New DotNetNuke.Entities.Users.UserInfo
  Dim OurUserController As New DotNetNuke.Entities.Users.UserController
  OurUserInfo = OurUserController.GetUser(Me.PortalId, OurUserID)
 
  Dim EmailBody As String
  'get the email body from setting
  EmailBody = ""
  If Not IsNothing(CType(Settings("denymail"), String)) Then 

       EmailBody = CType(Settings("denymail"), String)
  End If


  EmailBody = EmailBody.Replace("[DISPLAYNAME]", OurUserInfo.DisplayName)
  EmailBody = EmailBody.Replace("[FULLNAME]", OurUserInfo.FullName)
  EmailBody = EmailBody.Replace("[USEREMAIL]", OurUserInfo.Email)
  EmailBody = EmailBody.Replace("[USERPHONE]", RequestInfo.Phone)
  EmailBody = Server.HtmlDecode(EmailBody)

  DotNetNuke.Services.Mail.Mail.SendMail("programmer@mysite.com", OurUserInfo.Email, "", "Access Denied", EmailBody, "", "HTML", "", "", "", "")

'** The TO email addresses are limited somehow...not sure why

 

 


I'm too poor for anything other than the community version
 
New Post
5/17/2008 9:20 PM
 

DotNetNuke.Services.Mail.Mail.SendMail("programmer@mysite.com", OurUserInfo.Email, "", "Access Denied", EmailBody, "", "HTML", "", "", "", "")

The only way to really test your example is to issue multiple sends.

DotNetNuke.Services.Mail.Mail.SendMail("programmer@mysite.com", "email1@mysite.com, "", "Subject1", "Body1", "", "HTML", "", "", "", "")DotNetNuke.Services.Mail.Mail.SendMail("programmer@mysite.com", "email2@mysite.com, "", "Subject2", "Body2", "", "HTML", "", "", "", "")

 

If both emails are received, then something else in your code or your data is causing the problem. Like I mentioned, some servers will reject messages with an empty email, subject or body. The code you provided does not test for or ensure actual values per userID.

I hope this is of some help to you.


Dwayne J. Baldwin
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0SendMail Method in DNNSendMail Method in DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out