0

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

John
  • 4,658
  • 2
  • 14
  • 23
Tog Porter
  • 421
  • 1
  • 7
  • 23
  • 1
    The fact that you can send emails at all shows that the component is working, so it's most likely an issue with your smtp server. Here's a question which may be relevant, (even though it's about php) https://stackoverflow.com/questions/1107730/cant-send-email-to-addresses-at-my-own-domain Also see this one from Serverfault https://serverfault.com/questions/25068/sendmail-to-local-domain-ignoring-mx-records – John Jul 25 '18 at 10:22

2 Answers2

0

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.

Tog Porter
  • 421
  • 1
  • 7
  • 23
0

Use this code and replace your smtp server information

<%

Set myMail=CreateObject("CDO.Message")
myMail.BodyPart.Charset = "UTF-8"


myMail.Subject= Your Message Subject
myMail.From= "anotheremail@anotherdomain.com"
myMail.To=Receiver Email Address
myMail.CreateMHTMLBody "Test Email Subject"


myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")= SMTP_SERVER
myMail.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_Username
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword")=Smtp_Email_Password
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing

%>