Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ASP Email Question

Posted on 2012-04-04
3
285 Views
Last Modified: 2012-04-07
I am using this following code to send email via classic asp.

It all works fine if I use the correct mailFrom... but In case I change the fromEmail, it doesn;t work. I need to send invites in my application and the from email should be the agents email address and not my site's email address. Is there any way I can change it>

		Sub sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer, mailUsername, mailPassword)
			Set MyMail = CreateObject("cdo.message")
			MyMail.From = mailFrom
			MyMail.To = mailTo
			MyMail.Subject = mailSubject
			MyMail.HTMLBody = mailMessage
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailServer
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = mailUsername
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = mailPassword
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
			MyMail.Configuration.Fields.Update
			MyMail.Send
			Set MyMail = nothing
		End Sub

Open in new window

0
Comment
Question by:Aanvik
3 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 37808288
the problem is most possible with mail server/smtp configuration that set up so check mailFrom is originated on the site , admin should change it to be able to orginate elsewhere
0
 
LVL 30

Accepted Solution

by:
Wayne Barron earned 500 total points
ID: 37808306
I use "Google Apps" as my Hosting provider has a screwed up mail server setup that everything gets marked as spam.

So.
With Google Apps, I have to assign the account that is used in my Mail Forms, as "Administrator". If it is a basic account, it will not work.

I am unsure what mail hosting you are using, but if you have a way of making the accounts as "Administrator" then give it a shot, and try the mail again.

Good Luck
Carrzkiss
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37808701
Many web hosts will not allow you to send from an email address that does not exist on your account.  That's considered to be sending spam.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question