I have a friend who runs his website on a windows 2008 server. I have set up an asp classic form to email page on his website (hisdomain.com) which takes the input from a contact form and sends it out by email.

The problem is that it only works if the email is being sent to a different domain (something@anotherdomain.com). If the email is being sent to the same domain (anything@hisdomain.com) it never arrives.

Mailer.AddAddress "someone@anotherdomain.com"

Works.

Mailer.AddAddress "someone@hisdomain.com"

Does not work.

I have hunted this site and Google for a resolution but cannot find one.

Does anyone know how to fix this issue?

Many thanks

Tog Porter

Update: It turns out he uses Gmail business to control his domain emails and there was a filter in there that bounced the messages because the sender was the same as the recipient.

Bypassing the Gmail spam filter has fixed the problem.

    Use this code and replace your smtp server information

    <%Set myMail=CreateObject("CDO.Message")myMail.BodyPart.Charset="UTF-8"myMail.Subject=Your Message SubjectmyMail.From="anotheremail@anotherdomain.com"myMail.To=Receiver Email AddressmyMail.CreateMHTMLBody "Test Email Subject"myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")=SMTP_SERVERmyMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1 myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername")=SMTP_Email_UsernamemyMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword")=Smtp_Email_PasswordmyMail.Configuration.Fields.UpdatemyMail.Sendset myMail=nothing%>

      Your Answer

      By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

      Not the answer you're looking for? Browse other questions tagged or ask your own question.