Sending e-mail by Cdosysmail

Asked

Viewed 35 times

0

I have a shipping code for e-mail, I picked up the sender via request form. and put into a variable like this:

Dim nome, emailremetente
nome = trim(request.form("name"))
emailremetente = trim(request.form("email")) 

And on this line I insert the variables:

'NOME E E-MAIL DO REMETENTE
objCDOSYSMail.From = nome & "<" & emailremetente & ">" 

So far so good, however if in the form I insert my e-mail particular ([email protected]) it does not send, but if I insert mymail@mydomain_do-site-which is sent to.comen it sends.

That is, if the e-mail of the sender is from the same domain that is sending, it sends, but if it is from another domain it does not send, why and how to resolve this?

  • Make sure your SMTP server is set to Relay for different domains

  • A simple test is to connect to the account that is sending the email, through the browser or email manager, and try to send to this email...

2 answers

0

For SPAM and security-related reasons, most hosting providers (maybe ALL) do not send email via script when the sender’s domain is different from the site’s domain.

If your website domain is meusite.with, the sender must be @meusite.with.

0

It is really not recommended to put the from like any email, and servers generally only allow emails from the domain itself because of SPAM. But an alternative to this is the use of Reply-To.

With this technique, you keep the sender as an email from your domain, and add the header reply-to that makes, who receive the email and try to reply, the email that will be used for the reply will be indicated by reply-to.

The use would be that:

objCDOSYSMail.ReplyTo = "[email protected]"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.