Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP Email Question

Posted on 2012-04-04
3
Medium Priority
?
295 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 31

Accepted Solution

by:
Wayne Barron earned 2000 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 84

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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
how to add IIS SMTP to handle application/Scanner relays into office 365.

772 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